1# You use a hastag at the beginning of the line to make anything after it a comment
2'''
3You can also make a multi line comment
4With three single quotes at the beginning and end!
5'''
1# This is a comment
2
3""" This is a comment"""
4
5"""
6This is a comment
7Also this is a comment
8"""
9
1# one hashtag for a single line comment
2
3"""
43 quote marks is technically
5a docstring, but it works as
6a multi line comment
7"""
8
9##pressing 'Alt 3' in IDLE comments out
10##what you are selecting
11and 'Alt 4' to uncomment
12
13if False:
14 print('Hello') # yes you can do it at the end of a line
15 you can technically put if False around code you dont want it to run,
16 but that would mean it has to have correct syntax,
17 and would not be good for readability.
1select the lines you want to comment
2and 'use Ctrl + / to comment all of the selected text'.
3To uncomment do the same thing.
4OR
5put a '#' before each line
6
7eg : #This is a comment
1#This is a comment
2#And another one
3print("Hello !) #Comment in the same line
4
5"""
6A multiline
7comment
8"""
9print("Hello !)