import
keyword. Example of importing the math
library and using
its sqrt()
function to calculate the square root of a
number:
import math number = 36 square_root = math.sqrt(number) print(square_root) # 6
random
library and using its
randint()
function to generate a random number between 1
and 10:
import random number = random.randint(1, 10) print(number) # random number between 1 and 10
Your code
Your code
random_num = random.randint(1, 10) print(f"Your random number is {random_num}")
Your code
radius = 3 area = math.pi * math.pow(radius, 2) print(f"The area is {area}")
Your code
import math radius = random.randint(5, 10) area = math.pi * math.pow(radius, 2) print(f"The area is {area}")
Your code
Your code