Comments
Comments#
Comments are text annotations in code that explain what the code does. They help developers understand code without affecting how it runs.
There are two main types of comments: single-line and multi-line.
Single-Line Comments#
Single-line comments explain code on one line. They start with // in most languages or # in Python:
Multi-Line Comments#
Multi-line comments span multiple lines for longer explanations. They use /* */ in most languages: