Numbers
Last updated
# Integers
t1_int = 1
# Float
t1_float = 1.0
# Complex
t1_complex = 3.14j
# Hex
t1_hex = 0xa
# Octal
t1_octal = 0c10
# Add different type of numbers
print(1 + 0x1 + 0o1)
# Absolute value functions
print(abs(4))
# Round function
print(round(8.4))
# Print Binary representation of a number
print(bin(8))
# Print Hex representation of a number
print(hex(8))
Last updated