+ 2
Time-based codes not simulatable in Sololearn??
I tried to test a short code in Python, just to see how time-based functions would fare in Sololearn. I got a message telling me that the time limit was exceeded. It only worked when I removed the "time.sleep" function. Here is the code: import time for each in range(100): print(each) time.sleep(1)
4 Answers
+ 2
what is happening here is that sleep works okay, but sololearn interpreter waits until program finish to show any output, and sololearn doesnt accept 100 seconds of wait time. if instead of 100 you put 10(or less) you should see some delay in the output compared to not waiting anything.
+ 2
change range(100) with range(4) and it will works
+ 2
Okay, I get it now... That means the output will be shown, but not in real time. I was expecting a real-time output initially, which was why. Thanks, Ulisses Cruz , Bebida Roja and Sousou.