codescracker


python

Python Program to Convert Fahrenheit to Celsius



« Previous Program Next Program »


Convert Fahrenheit to Celsius in Python

To convert temperature from Fahrenheit to Celsius in python, you have to ask from user to enter temperature in Fahrenheit to convert that temperature into Celsius as shown in the program given below.

Python Programming Code to Convert Fahrenheit to Celsius

Following python program ask from user to enter the value of Fahrenheit to convert it into Celsius:

# Python Program - Convert Fahrenheit to Celsius
		
while True:
	print("Enter 'x' for exit.")
	fah = input("Enter Temperature in Fahrenheit: ")
	if fah == 'x':
		break
	else:
		fahrenheit = float(fah)
		celsius = (fahrenheit-32)/1.8
		print("Temperature in Celsius =",celsius,"\n")

Here is the sample run of the above Python program demonstrating how to convert temperature from Fahrenheit to Celsius:

python convert fahrenheit to celsius

Same Program in Other Languages

You may also like to learn or practice the same program in other popular programming languages:


« Previous Program Next Program »




Tools
Calculator

Quick Links
Signup - Login - Give Online Test