Aug-23-2020, 08:08 AM
def check1(): import time if stat1 < 5: while stat1 <5: print('smaller_than_5') time.sleep(1) print('same_or_bigger_than_5') #I get the error message here. else: print('same_or_bigger_than_5')I'm trying to code something that can check a number called 'stat1' every second and see if it is bigger or smaller than 5. I want it to keep showing "smaller than 5" until it same or bigger than 5 and finally stop by showing the "same or higher than 5" message. But I keep getting an error message for line 7. But if the line is removed, it just stops when it is 5 or bigger than 5 and doesn't show the message.