This is lab 1 from CS61A. I don't understand the answer.
For question 1, why is it an infinite loop? Is it because means has a value?
>>> positive = 28
>>> while positive:
... print("positive?")
... positive -= 3
______
For question 2, why the program end after it printed -12, -9, and -6?
>>> positive = -9
>>> negative = -12
>>> while negative:
... if positive:
... print(negative)
... positive += 3
... negative += 3
______
I am still a beginner of it and thank you for answering my question.
I tried to use PythonTutor but I still not understand why.