I'm trying to create a table that converts Celsius to Fahrenheit, I have to use the main() function and the counter-controlled loop "for". When I put in 21, the program will run all the way until 30. How can I get it to stop at the number the user puts in? I need it to range from 0 to the input number.
# Table of Temperatures start = 1 end = 31 increment = 1 input("Enter a number: ") print() def main(): print("Celcius \t Farenheit") def fahrenheit(T_in_celsius): return (T_in_celsius * 9 / 5) + 32 for t in range (start, end, increment): print(t, "\t\t ", fahrenheit(t)) main()