+ 1

Time limit exceeded error

Getting a time limit exceeded message and also the variable clockOtpt isn't defined. Help?

12th Dec 2016, 7:57 PM
mThompsett
mThompsett - avatar
5 odpowiedzi
+ 1
#1 minute timer import time clockOtpt=0 while clockOtpt<60: clockOtpt=clockOtpt+1 print(clockOtpt) time.sleep(1) print("1 minute has passed")
12th Dec 2016, 9:08 PM
mThompsett
mThompsett - avatar
+ 1
But in theory this should work? It's just the playground area doesn't allow the code to complete a full loop?
12th Dec 2016, 9:35 PM
mThompsett
mThompsett - avatar
0
Show the code.
12th Dec 2016, 8:07 PM
Rishi Anand
Rishi Anand - avatar
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
12th Dec 2016, 9:33 PM
Amaras A
Amaras A - avatar
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
14th Dec 2016, 2:00 PM
Elric Hindy
Elric Hindy - avatar