math module application
math module application
Write a Python program that calculates the area of a circle given its radius. Use the math
module to access the value of π (pi).
import math
Write a Python program that computes the square root of a given number using the math
module.
Answer:
import math
# Input: number to find the square root of
square_root = math.sqrt(number)
Write a Python program that calculates the Greatest Common Divisor (GCD) of two numbers
using the math module.
Answer:
import math
# Calculate GCD