Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 1.07 KB

File metadata and controls

69 lines (45 loc) · 1.07 KB

Python Comments

Single-Line Comment

Python uses the hash symbol (#) to create a comment.

Syntax

# This is a comment

Example

# This program prints a message

print("Hello, World!")

Output

Hello, World!

Multiple Single-Line Comments

Python does not have a special multi-line comment syntax.

Write # on every line.

# This is a comment
# written in
# multiple lines

print("Hello")

Output

Hello

Triple Quotes (''' or """)

                      Multiple Comments

Example

"""
Robert John Downey Jr. (born April 4, 1965) is an American actor and producer. His films have grossed over $14.3 billion worldwide, making him one of the highest-grossing actors of all time. He was the world's highest-paid actor from 2013 to 2015. He has received numerous awards, including an Academy Award, a Daytime Emmy Award, three Golden Globe Awards, and two British Academy Film Awards.
"""

print("Robert John Downey Jr.")

Output

Robert John Downey Jr.