+ 1
Time limit exceeded error
Getting a time limit exceeded message and also the variable clockOtpt isn't defined. Help?
5 Antworten
+ 1
#1 minute timer
import time
clockOtpt=0
while clockOtpt<60:
clockOtpt=clockOtpt+1
print(clockOtpt)
time.sleep(1)
print("1 minute has passed")
+ 1
But in theory this should work? It's just the playground area doesn't allow the code to complete a full loop?
0
Show the code.
0
From my small testing, it seems that SoloLearn gives (around) 4.5 seconds for the code to finish. You can't wait for a whole minute this way, sadly.
It might just work fine on any computer, but not SoloLearn.
Also, the variable *is* defined, no problem
0
I noticed that the 'compiler' of sololearn, runs the entire script and returns the output. if the script takes longer than about 5 seconds to run then it times out and does not print on output. try the with qpython app or similar or on your pc if you can