17  python as a calculator

Python can be used a calculator. Python has all the necessary operators and rules as you know from school.

print(4+5)

print(4*5)

print(5/2)

print(5%2)

print(5//2)


print(2+1/3*3)

out: 3.0

print((2+(1/3))*3)

out: 7.0


print(2**5)

Common operators

Only following operators are a bit different than normal mathematical ones.

17.2 Video Tutorials