Quick actions

cmd+k|ctrl+k

Navigation

Languages

numbers

Snippet info

Language

Python

Visibility

public

Author

seamus0

Created

2025-12-05T16:47:27.535075Z

Updated

2025-12-05T17:35:27.292363Z

print(2 + 4)
print(type(2 + 4))
print(2 - 4)
print(2 * 4)
print(2 / 4)
print(type(2 / 4))
# // rounds down e.g.
print(5 // 4)
# % is modulo, it returns the remainder e.g.
print(6 % 4)

# Math functions
# round down
print(round(3.1))
# abs is no negative numbers changes it to a positive e.g.
print(abs(-20))
# bin prints the binary representation (it will have 0b at the beginning to show its binary)
print(bin(5))
# convert binary to int (convert base 2 to base 10) e.g.
print(int('0b101', 2))
INFO