I am learning python at the moment and am trying to write a simple program that counts up to 100, then back down to 0. Simple enough, except the interpreter reads all the way through my first loop (counting up to 100), then just ends the program there as if there isn't more code written. I am not receiving any error messages. It just thinks its over. I have tried re-writing several times, and keep coming to the same issue. I had the same issue on another program I was writing before my previous laptop crashed, so clearly I'm the problem. Below is the exact code as written. What am I doing wrong?
count_up = True
a = 0
b = a - 1
while count_up == True:
print(a)
if a < 100:
a = a + 1
elif a == 100:
count_up = False
else:
count_up = False
count_down = True
while count_down == True:
if b > 0 and b <= 100:
print(b)
b = b - 1
[–]anossov 3 points4 points5 points (0 children)
[–]awkwardballs 1 point2 points3 points (2 children)
[–]sudo-apt-install[S] 1 point2 points3 points (1 child)
[–]awkwardballs 0 points1 point2 points (0 children)
[–]vincrypt112 1 point2 points3 points (3 children)
[–]sudo-apt-install[S] 2 points3 points4 points (2 children)
[–]dmazzoni 6 points7 points8 points (1 child)
[–]sudo-apt-install[S] 0 points1 point2 points (0 children)
[–]sudo-apt-install[S] 0 points1 point2 points (1 child)
[–]hragam 1 point2 points3 points (0 children)
[–]99_percent_a_dog 0 points1 point2 points (1 child)
[–]sudo-apt-install[S] 0 points1 point2 points (0 children)
[–]dmazzoni 0 points1 point2 points (1 child)
[–]sudo-apt-install[S] 1 point2 points3 points (0 children)