python comment block
# You use a hastag at the beginning of the line to make anything after it a comment
'''
You can also make a multi line comment
With three single quotes at the beginning and end!
'''
4
1
# This is a comment
""" This is a comment"""
"""
This is a comment
Also this is a comment
"""
Thank you!
1
0
4.33
6
#This is a comment
#And another one
print("Hello !) #Comment in the same line
"""
A multiline
comment
"""
print("Hello !)
Thank you!
6
0
3.86
7
"""
this
is
a multiline
comment
"""
Thank you!
7
0
4.13
8
# one hashtag for a single line comment
"""
3 quote marks is technically
a docstring, but it works as
a multi line comment
"""
##pressing 'Alt 3' in IDLE comments out
##what you are selecting
and 'Alt 4' to uncomment
if False:
print('Hello') # yes you can do it at the end of a line
you can technically put if False around code you dont want it to run,
but that would mean it has to have correct syntax,
and would not be good for readability.
Thank you!
8
0
3.6
5
select the lines you want to comment
and 'use Ctrl + / to comment all of the selected text'.
To uncomment do the same thing.
OR
put a '#' before each line
eg : #This is a comment
Thank you!
5
0
Are there any code examples left?
New code examples in category Python