The Python Software Foundation code example
Example 1: python
print('Hello World boi')
Example 2: python
# a comment
myVar = 5
avar = 53
tr = 13 # vars
while True:
#code for while true loop
Example 3: python
n = int(input('Type a number, and its factorial will be printed: '))
if n < 0:
raise ValueError('You must enter a non negative integer')
fact = 1
for i in range(2, n + 1):
fact *= i
print(fact)