Okay, so after the whole incident two years ago with a really terrible computer science GTA teaching C++ in the summer I have decided to give programming another chance. But this time I am teaching myself Python at my own pace and I am currently using an intro book. And I have a question for you Python experts on a simple question.
My question is, why do i have to use the (10, 110, 10) on my code? I am currently learning Python 3.6 on Mac.
for i in range(10, 110, 10)
I had this originally:
# Programming Exercise 5:
# 5.) Modify the convert.py program (Section 2.2) so that it computes and prints
# a table of Celsius temperatures and the Fahrenheit equivalents every 10
# degrees from 0°C to 100°C.
#
#-------------------------------------------------------------------------------
# convert.py
# A program to convert Celsius temps to Fahrenheit
# by: Renee Yaldoo
def main():
print("This program computes and prints a table of Celsius temperatures")
print("and the Fahrenheit equivalents every 10 degrees from 0°C to 100°C.")
for i in range(10):
celsius = i
fahrenheit = 9/5 * celsius + 32
print(str(celsius)+"\t"+str(fahrenheit))
input("Press the <Enter> key to quit.")
main()
But this would be my output when the program would run:
This program computes and prints a table of Celsius temperatures
and the Fahrenheit equivalents every 10 degrees from 0°C to 100°C.
0 32.0
1 33.8
2 35.6
3 37.4
4 39.2
5 41.0
6 42.8
7 44.6
8 46.4
9 48.2
Press the <Enter> key to quit.
Can someone here please explain why I need to use (10, 110, 10)? I haven't gotten too far into the book I am using (Python Programming 3rd Edition by John Zelle). I'm only on Chapter 2 right now. Thank you for taking the time reading and responding to this. Happy Holidays, and Merry Christmas everyone! :)