0

Time limit exceeded

Hello, I'm trying to execute small code in Python 3, but getting"Time limit exceeded" in the output always. Here is the code: import time i = 1 j= '*' while i <=5: if i <=3: print(j*i) time.sleep(1) # Delay to see the pattern else: print((3+(3-i))*j) time.sleep(1) # Delay to see the pattern i +=1

14th Oct 2018, 10:12 PM
Basavaraj
2 Respostas
+ 2
Remove time.sleep(1) SoloLearn's Code Playground runs on someone else's PC. Which means you can't see the output in real time. So you can't use time.sleep()
14th Oct 2018, 11:13 PM
qwerty
qwerty - avatar
+ 1
@qwerty Thank you.
15th Oct 2018, 1:50 AM
Basavaraj