I have an infinite loop that immediately goes to sleep for one minute and then displays a message, but the problem is that when I stop the loop, the sleep() function works and the message is displayed at the end. Is it possible to reset sleep() after stopping the loop immediately?
from time import sleep
i = int(input())
flag = True
while flag:
if i < 0:
flag = False
sleep(60)
print('Hello, world')