Quick actions

cmd+k|ctrl+k

Navigation

Languages

Numbers

Snippet info

Language

Python

Visibility

public

Author

e.sgl

Created

2026-05-05T20:39:53.456379Z

Updated

2026-05-05T21:03:39.588446Z

# Fundamental Data Types
# int
# float
# complex - Complex numbers (real, [imgae])
# bool
# str
# list
# tuple
# set
# dict

# Classes -> Custom types

# Specialized Data Types

# None - A special type that represesnts an empty value (null)

print(type(6))
print(type(2 + 4)) # int
print(type(2 - 4)) # int
print(type(2 * 4)) # int
print(type(2 / 4)) # float (0.5)

print(2 ** 3) # 2 ^ 3 = 8 (2 to the power of 3)
print(5 // 4) # 5 / 4 rounded down - returns an int = 1
print(6 % 4) # Modulu - return 2

# Math functions
print(round(3.7)) # rounds the float up or down (up in this case)
print(abs(-3.4))

# Ex1
print((5 + 4) * 10 / 2) # 45.0
print(((5 + 4) * 10) / 2) # 45.0
print((5 + 4) * (10 / 2)) # 45.0
print(5 + (4 * 10) / 2) # 25.0
print(5 + 4 * 10 // 2) # 25

print(bin(5)) # prints the binary presentation of the number 5 (101)
print(int('0b101', 2)) # Convert the binary number (2 is the base of binary numbers) to int, and print it

INFO