Jun-28-2017, 03:44 PM
Good Morning. I have some beginner/intermediate coding experience and decided to learn a new language. I am working through a book that teaches Python 2.7. This question seems pretty simple, I made a While loop that worked. Then I was asked to put it in a function and I am getting a syntax error on Line 9 - While i < stop:. Is the indention wrong? Thanks in advance for any help on this.
stop = raw_input("How high should we count? ") increment = raw_input("What should we count by? ") def list_numbers(stop, increment): i = 0 numbers = [] While i < stop: print "At the top i is %d" % i numbers.append(i) i = i + 1 print "Numbers now: ", numbers print "At the bottom i is %d" % i print "The numbers: " for num in numbers: print num list_numbers(stop, increment)