2 Python Comments
2 Python Comments
OBJECTIVES
• STUDENTS WILL BE ABLE TO LEARN ABOUT PYTHON COMMENTS
• LEARN HOW TO USE PYTHON COMMENTS
PYTHON COMMENTS
# printing a number
print(25)
Output: 25
Here, # printing a number is a comment. This part is completely
ignored by the computer.
COMMENTS EXAMPLE
# print name
print(name) # John
NOTE:
• Remember the keyboard shortcut to
apply comments. In most text editors,
it's Ctrl + / if you are on Windows
& Cmd + / if you are on a Mac.
MULTILINE COMMENTS
• Python doesn't have dedicated multi-line comment syntax like some other programming
languages like C++ and Java.
• However, we can achieve the same effect by using the hash (#) symbol at the beginning
of each line.
Oral Recitation:
number2 = 15