This repository contains a set of 10 tasks that involve using the math module. To complete the homework, follow the instructions below:
- Fork this repository to your own GitHub account.
- Solve each task by writing the required code.
- Commit your solutions with appropriate commit messages.
- Push the changes to your GitHub repository.
- Submit the link to your repository for grading.
Write a Python program that calculates the square root of a given number using the math module.
# Calculate the square root of a number
# Example usage
input_number = 16
result = calculate_square_root(input_number)
print(result) # Output: 4.0Write a Python program that calculates the factorial of a given number using the math module.
# Calculate the factorial of a number
# Example usage
input_number = 5
result = calculate_factorial(input_number)
print(result) # Output: 120Write a Python program that calculates the sine, cosine, and tangent of an angle using the math module.
# Perform trigonometric calculations
# Example usage
input_angle = 45
sine, cosine, tangent = perform_trigonometric_calculations(input_angle)
print("Sine:", sine) # Output: 0.7071067811865475
print("Cosine:", cosine) # Output: 0.7071067811865476
print("Tangent:", tangent) # Output: 0.9999999999999999Write a Python program that calculates the logarithm of a number to a specified base using the math module.
# Calculate the logarithm of a number\
# Example usage
input_number = 100
input_base = 10
result = calculate_logarithm(input_number, input_base)
print(result) # Output: 2.0Write a Python program that calculates the exponential value of a number using the math module.
# Calculate the exponential value of a number
# Example usage
input_number = 2
result = calculate_exponential(input_number)
print(result) # Output: 7.3890560989306495Write a Python program that rounds a decimal number to the nearest integer using the math module.
# Round a decimal number to the nearest integer
# Example usage
input_number = 3.7
result = round_to_nearest_integer(input_number)
print(result) # Output: 4Write a Python program that calculates the ceiling and floor values of a number using the math module.
# Calculate the ceiling and floor values of a number
# Example usage
input_number = 4.3
ceiling, floor = calculate_ceiling_floor(input_number)
print("Ceiling:", ceiling) # Output: 5
print("Floor:", floor) # Output: 4Write a Python program that converts an angle from degrees to radians using the math module.
# Convert an angle from degrees to radians
# Example usage
input_degrees = 90
result = convert_degrees_to_radians(input_degrees)
print(result) # Output: 1.5707963267948966Write a Python program that converts an angle from radians to degrees using the math module.
# Convert an angle from radians to degrees
# Example usage
input_radians = 1.5707963267948966
result = convert_radians_to_degrees(input_radians)
print(result) # Output: 90.0Write a Python program that calculates the power of a number using the math module.
# Calculate the power of a number
# Example usage
input_base = 2
input_exponent = 3
result = calculate_power(input_base, input_exponent)
print(result) # Output: 8.0Once you have completed all the tasks, your homework will be ready for submission. Good luck!