Oct-26-2022, 09:36 AM
Hello,
I'm trying to input a list with a While loop, and then print the list when it is over 100 (the number), but it keeps going even though I put a break in.
I've been trying and thinking about doing it all day yesterday and today too.
This is my code:
Thanks.
I'm trying to input a list with a While loop, and then print the list when it is over 100 (the number), but it keeps going even though I put a break in.
I've been trying and thinking about doing it all day yesterday and today too.
This is my code:
input=int(input('Number? '))
list=[]
while True:
if input <= 100:
list.append(input)
else:
list.append('over')
break
print(list)Any help would be greatly appreciated and try to explain my mistakes too please. Thanks.
