Quick actions

cmd+k|ctrl+k

Navigation

Languages

3. if code block

Snippet info

Language

Python

Visibility

public

Author

aaron.lung.wai

Created

2022-11-23T14:11:01.013516Z

Updated

2026-03-02T12:26:47.168393Z

#An if block

#The if statement
if 1 == 1:
#Notice that the next line has four spaces
    print ("1 equals 1")

if 1 == 2:
    #The code won't be executed
    print("python is wrong")

print("This code is executed no matter what")
INFO