Syntax

Python Write a Comment Syntax

In Python, write a comment: adds a comment that Python ignores — # comment

Quick Answer

Syntax
# comment
PythonSyntax

Write a Comment

Code example
# comment

Adds a comment that Python ignores.

Learn More

How to write a comment in Python

  1. Open your Python file or editor.
  2. Copy the example, then replace its sample names and values for your code.

Python Write a Comment Syntax

Use # comment.

Related Syntax References

Frequently asked questions

What is the Python syntax for write a comment?

Use this pattern: # comment

Can I copy this Python code example?

Yes. Use Copy code and adapt the example to your program.

Is this Python syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify