You are on page 1of 1

1) Celsius to Farenheit converter:

Write a Python program that converts a temperature from Celsius to Fahrenheit. The
program should take the user's input for the temperature in Celsius and output the equivalent
temperature in Fahrenheit.

celsius = float(input("Enter temperature in Celsius: "))


fahrenheit = (celsius * 9/5) + 32
print(f"{celsius} Celsius is equal to {fahrenheit} Fahrenheit.")

2) BMI calculator:
Write a Python program that calculates the body mass index (BMI) for a person. The program
should take the user's input for the person's weight (in kilograms) and height (in meters) and
output their BMI.
weight = float(input("Enter weight in kilograms: "))
height = float(input("Enter height in meters: "))
bmi = weight / (height ** 2)
print(f"Your BMI is {bmi:.2f}.")

3) Simple Calculator interest:


Write a Python program that calculates the simple interest for a given principal amount,
interest rate, and time period. The program should take the user's input for these three
values and output the resulting simple interest.
principal = float(input("Enter principal amount: "))
rate = float(input("Enter interest rate: "))
time = float(input("Enter time period (in years): "))
simple_interest = (principal * rate * time) / 100
print(f"Simple interest = {simple_interest:.2f}.")

4) Quotient and remainder Calculator:


Write a Python program that calculates the quotient and remainder of two given numbers.
The program should take the user's input for these two values and output the resulting
quotient and remainder.
dividend = int(input("Enter dividend: "))
divisor = int(input("Enter divisor: "))
quotient = dividend // divisor
remainder = dividend % divisor
print(f"Quotient = {quotient}, Remainder = {remainder}.")

5) Power of a number calculator:


Write a Python program that calculates the power of a given number. The program
should take the user's input for the base and exponent and output the resulting
power.
base = float(input("Enter base: "))
exponent = int(input("Enter exponent: "))
result = base ** exponent
print(f"{base} raised to the power of {exponent} is {result}.")

You might also like