Math & Random Module
Math Module
import math
print(math.pi) # Output: 3.141592653589793
print(math.e) # Output: 2.718281828459045import math
print(math.sqrt(16)) # Output: 4.0
print(math.log10(1000)) # Output: 3.0
print(math.sin(math.pi/2)) # Output: 1.0import math
print(math.factorial(5)) # Output: 120
print(math.fabs(-3.14)) # Output: 3.14
print(math.perm(5, 2)) # Output: 20
print(math.comb(5, 2)) # Output: 10
print(math.sinh(1.5)) # Output: 2.1292794550948173Random Module
Last updated