Answer:
# Prompt the user to enter the stopping value (in Celsius)
stop = int(input("Enter the stopping value in Celsius: "))
# Print the table heading
print("Celsius\tFahrenheit")
print("-------\t----------")
# Iterate over the range of Celsius temperatures divisible by 20
for celsius in range(0, stop + 1, 20):
# Convert the temperature to Fahrenheit
fahrenheit = celsius * 9/5 + 32
# Print the temperature in both Celsius and Fahrenheit
print(f"{celsius}\t{fahrenheit:.1f}")
Step-by-step explanation:
This program prompts the user to enter the stopping value in Celsius, and then uses a range-based for loop to iterate over the range of Celsius temperatures that are divisible by 20. For each temperature, it converts the temperature to Fahrenheit using the provided formula, and then prints the temperature in both Celsius and Fahrenheit. The output is formatted to display one decimal place for the Fahrenheit temperatures.
Tell me if this helped :)