Respuesta :
Answer:
Part 1:
- for i in range(0, 21):
- print(i)
Part 2:
- for i in range(0, 21):
- print(i, int((i * 1.8) + 32))
Part 3:
- for i in range(0, 21):
- print(i, '\t', int((i * 1.8) + 32))
Part 4:
- print("Celcius\tFahrenheit")
- print("--------------------")
- for i in range(0, 21):
- print(i, '\t', int((i * 1.8) + 32))
Explanation:
In Part 1, create a for loop that will print the value i from 0 to 20 (21 is exclusive).
In Part 2, we can apply the formula to convert Celsius to Fahrenheit and print both Celsius and Fahrenheit value together.
In Part 3, we use "\t" to create a tab between Celcius and Fahrenheit values
In Part 4, we add print statements above the for loop to print the name of temperatures and a line of dashes. The output is as follows:
Celcius Fahrenheit
--------------------
0 32
1 33
2 35
3 37
4 39
5 41
6 42
7 44
8 46
9 48
10 50
11 51
12 53
13 55
14 57
15 59
16 60
17 62
18 64
19 66
20 68
Answer:
print("Celcius\tFahrenheit")
print("- - - - - - - - - -")
for degree_in_celcius in range(0,21):
degree_in_fahrenheit = int(round((9 * degree_in_celcius) / 5 + 32))
print(degree_in_celcius, "\t", degree_in_fahrenheit)
Explanation:
- Use two print statements to print the header and dashes
- Initialize a for loop ranging from 0 to 20
- Inside the loop, convert the degree to the Fahrenheit using formula
- Print the results