Python Program to Convert Celsius To Fahrenheit – 2024

Hey guys, in this blog we will see a Python Program to Convert Celsius To Fahrenheit.

We will use the following formula to convert Celcius to Fahrenheit.

F = 9/5*C + 32

Code

# Python Program to Convert Celsius To Fahrenheit

celsius = input('Enter the temperature in Celcius -> ')

fahrenheit = (9*float(celsius))/5 +32

print(f'{celsius}C = {fahrenheit}F')

Output

Enter the temperature in Celcius -> 5
5C = 41.0F
Enter the temperature in Celcius -> 10
10C = 50.0F
Enter the temperature in Celcius -> 45
45C = 113.0F
  • Taking the input from the user.
  • Converting it to float.
  • Applying the formula for converting Celcius to Fahrenheit.

Check out our other python programming examples

Leave a Reply

Your email address will not be published. Required fields are marked *