0
How to get back to the loop?
while 1==1: i=int(input("number:")) assert(i<10), "your number is bigger than 10" well, how can i get back to the loop after an assertion error occured? edit: thanks for the answers. but i want to error be seen still. after the error, how can i get back to the loop? i tried "continue" statement after "finally:" but it didnt work.
2 odpowiedzi
+ 1
while 1==1:
i=int(input("number:"))
try:
assert(i<=10), "your number is bigger than 10"
except AssertionError as e:
print("Error: {0}".format(e.args[0]))
0
assert(i<10, "anything")