Jun-28-2017, 04:25 PM
Since you are in the learning stage, It would be a good idea to buy another book that uses python 3
As far as your code is concerned, your statement
there are other issues, not checking validity of input value, etc. but another issue.
change your input statement to read:
Sooner or later someone will enter non valid input and blow the program up
As far as your code is concerned, your statement
stop = raw_input("How high should we count? ")inputs a string, not an integer, so when you use the statement
While i < stop:you are trying to compare an int to a string.
there are other issues, not checking validity of input value, etc. but another issue.
change your input statement to read:
stop = int(raw_input("How high should we count? "))Again, you will need assert that the input is capable of integer conversion.
Sooner or later someone will enter non valid input and blow the program up