Steps:
- Create a file with .py extension. - Write solution of given problem and save - Run to get the Output
Solution/code: temperature.py filefahrenheit = float(input("Enter temperature in fahrenheit : ")) celsius = (fahrenheit -32)* 5/9 print('Entered Fahrenheit is:' ,fahrenheit) print('Fahrenheit to Celsius is:' ,celsius)
OutputEnter temperature in fahrenheit : 93.2 Entered Fahrenheit is: 93.2 Fahrenheit to Celsius is: 34.0
Explanation:- print() : used to print a python objects(string, list, tuple, etc.). - Syntax: print(object(s), sep, end, file, flush) - Celsius to Fahrenheit Formula :- Celsius = (Fahrenheit – 32) * 5/9 - Fahrenheit to celsius :- Fahrenheit = (Celsius * 9/5) + 32 - To convert the input to int or float we have to use the int() and float() method
Proverbs 8:33
Hear instruction, and be wise, and refuse it not.
0 Comments