Skip to content

Commit 8aee6be

Browse files
authored
update Python Program to Convert Celsius To Fahrenheit and Vice Versa
In the following program, we are taking the input from the user, a user enters the temperature in Celsius and the program converts the entered value into Fahrenheit using the conversion formula we have seen above.
1 parent f581e7e commit 8aee6be

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
celsius = float(input('Enter temperature in Celsius: '))
2-
3-
4-
5-
6-
7-
fahrenheit = (celsius * 1.8) + 32
8-
9-
print('%0.1f Celsius is equal to %0.1f degree Fahrenheit'%(celsius,fahrenheit))
1+
fahrenheit = float(input("Enter temperature in fahrenheit: "))
2+
celsius = (fahrenheit - 32) * 5/9
3+
print('%.2f Fahrenheit is: %0.2f Celsius' %(fahrenheit, celsius))

0 commit comments

Comments
 (0)