[Tutor] While Loop Question

Rafael Skovron rskovron at gmail.com
Wed May 10 21:53:21 EDT 2017


Sorry I left out the indents in my previous email. It seems like j is
always reset to zero. Why does j vary?

Are there two different instances of j going on?


for i in range(1, 5):

    j=0

   while j < i:

         print(j, end = " ")

         j += 1


More information about the Tutor mailing list