In: Computer Science
I need to write this program in Python. Write a program that displays a temperature conversion table for degrees Celsius and degrees Fahrenheit. The tabular format of the result should include rows for all temperatures between 70 and 270 degrees Celsius that are multiples of 10 degrees Celsius (check the sample below). Include appropriate headings on your columns. The formula for converting between degrees Celsius and degrees Fahrenheit is as follow F=(9/5C) +32
Celsius | Fahrenheit |
---|---|
70 | 158 |
80 | 176 |
90 | 194 |
100 | 212 |
.... | ... |
... | ... |
270 | 518 |
begin = 70
end = 270
i = 10
def main():
print('Celsius\t
Farenheit')
print('____________________')
for C in range (begin, end, i):
F = (9 / 5) * C +
32
print(C, ' \t\t',
format(F, '.0f'))
main()