+ 3
Loop not working?
When I type age + 1 then it just goes 1 over than the expected number? Any help appreciates =) https://code.sololearn.com/cj96ZnRR3JAI/?ref=app
2 Answers
+ 6
https://code.sololearn.com/cx0JnrP6skq1/?ref=app
+ 3
Your loop runs while age is less than or equal too 18... It is ALWAYS less than or equal to with your code so the loop will run forever
age = 7
while age < 18:
age += 1
if age == 18:
print(age)
print("yeeeeaas")