โ `floor()`
Returns the nearest whole number less than or equal to the given number. import math math.floor(3.5) # 3 math.floor(3.9) # 3 math.floor(-3.5) # -4 math.floor(-2.8) # -3 โ trunc() Cuts off the decimal part and moves the number towards zero. math.trunc(2.8) # 2 math.trunc(-2.8) # -2 ๐ Number Conversion โค Binary bin(2) # '0b10' int('10', 2) # 2 โค Octal oct(64) # '0o100' int('100', 8) # 64 โค Hexadecimal hex(64) # '0x40' int('40', 16) # 64 ๐ข Decimal Used for exact decimal values (like money). ...