Using python
Write a program that displays a table of Celsius temperatures 0 through 20 and their Fahrenheit equivalents. The conversion formula is Fahrenheit = 9/5 * Celsius +32 Your program must use a loop to display table.
Code:
print("Celcius","Forenheit")
#iterating celcius from 0 to 20
for celcius in range(0,21):
#calculating forenheit for each celcius
forenheit = (9/5)*celcius + 32
# printing celcius and forenheit upto 2 decimals separated by
tabs
print("{:.2f}".format(celcius),"\t","{:.2f}".format(forenheit))
INDENTED CODE SCREENSHOT:
OUTPUT:
Get Answers For Free
Most questions answered within 1 hours.