Question

Write a program that displays a table of Celsius ternperatures 0 through a number entered by the user and their Fahrenheit eq

Write a program that displays a table of Celsius temperatures 0 through a number entered by the user and their Fahrenheit equivalents as in the figure below. The formula for converting a Celsius temperature to a Fahrenheit temperature is:

F = 9 / 5 * C + 32

where F is the Fahrenheit temperature and C is the Celsius Temperature. Your program must use a 'for' loop. Display all temperatures to one decimal place.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE

==============

n = int(input("Enter the number of celsius temperatures to display: "))

print("Celsius Fahrenheit")

for i in range(n+1):

fahrenheit = (i * 1.8) + 32

if i < 10:

print("%.1f %.1f" %(i, fahrenheit))

else:

print("%.1f %.1f" %(i, fahrenheit))

saved main.py 1 n int (input(Enter the number of celsius temperatures to display: )) 2 3 print(Celsius\tFahrenheit) 4 for

Add a comment
Know the answer?
Add Answer to:
Write a program that displays a table of Celsius temperatures 0 through a number entered by...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT