How to use comments | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to use comments

About comments

3rd Aug 2022, 10:21 AM
AdewaleTunmise
3 Answers
+ 4
technically comments are handled differently in the various programming languages. but the way which content is put in a comment and how we phrase it should be the same in all languages. please use google for more details and recommendations. in the pep 8 from python you can find some helpful hints: https://peps.python.org/pep-0008/#comments
3rd Aug 2022, 10:43 AM
Lothar
Lothar - avatar
+ 3
Please tag the relevant language
3rd Aug 2022, 10:39 AM
Chigozie Anyaeji 🇳🇬
Chigozie Anyaeji 🇳🇬 - avatar
+ 2
Use comments to write notes to explain what your code does. Many languages share the same comment expression But some are different Single line comments // This is a single line comment in JS // This is a single line comment in C# # This is a single line comment in Python # This is a single line comment in Ruby Multi-line comments /* Multi-line comments in JavaScript */ /* Multi-line comments in C */ =begin Multi-Line comment in Ruby =end
3rd Aug 2022, 10:42 AM
Chris Coder
Chris Coder - avatar