Quick actions

cmd+k|ctrl+k

Navigation

Languages

ZTM-TCPD-03

Snippet info

Language

Python

Visibility

public

Author

lawkoh

Created

2025-03-25T13:29:53.480566Z

Updated

2025-03-25T14:14:26.235519Z

#Fundamental Data Types
#int, eg 4 5 integers
#float, eg 0.5 floating point number, number with decimal point
print(type(2 + 4)) # 6
print(type(2 - 4)) # -2
print(type(2 * 4)) # 8
print(type(2 / 4)) # 0.5

print(type(5.00001))
print(type(0))
print(type(10.56))
# https://docs.python.org/3/tutorial/floatingpoint.html

print(type(20+1.1))
print(type(9.9+1.1))
print(9.9+1.1)

print(2 ** 3) # ** means to the power of
print(5 // 4) # // means integer division, get the whole number after divide
print(6 % 4)  # % means modulus, get the remainder of the division

# math functions / actions
print(round(3.1)) # 3
print(round(3.9)) # 4

print(abs(-20)) # absolute value of / no negative number
# https://docs.python.org/3/library/math.html
INFO