Why does the time limit exceed and stop after the loop ends? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why does the time limit exceed and stop after the loop ends?

Help https://code.sololearn.com/c1Ac0x0WfC45/?ref=app

12th Jul 2018, 10:58 AM
Raphael Shay
Raphael Shay - avatar
13 Answers
+ 2
I rewrote the code. Is it how it is supposed to work? https://code.sololearn.com/cc3ujC0N3774/?ref=app
12th Jul 2018, 11:54 AM
Satyam
+ 2
Time limit didn't exceed in mine. It just says 6 spy number and then an error.
12th Jul 2018, 11:00 AM
Satyam
+ 2
Umm. what are you trying to do anyway? I will try and recode it.
12th Jul 2018, 11:05 AM
Satyam
+ 2
you're welcome! Look up 'string slicing'. Ask if you still don't understand. Right now, I am too lazy to give an answer! lol And here is a TIP: Avoid using global variables.
16th Jul 2018, 4:31 PM
Satyam
+ 2
I edited the code. Check it out. You should pass the variable as an argument instead of using global variables. This code doesn't change the value of the original inputNumber unlike the last one. Look up why they are bad. I don't have enough experience and knowledge to answer that!
17th Jul 2018, 2:47 AM
Satyam
+ 2
Thanks!
17th Jul 2018, 4:54 AM
Raphael Shay
Raphael Shay - avatar
+ 1
How do I fix the error then?
12th Jul 2018, 11:00 AM
Raphael Shay
Raphael Shay - avatar
+ 1
It's not the final product. But to list the first character in the input, then remove it and print the first character again. Until there is nothing left of the string.
12th Jul 2018, 11:07 AM
Raphael Shay
Raphael Shay - avatar
+ 1
what?
12th Jul 2018, 2:16 PM
Satyam
+ 1
S. C. THANKS!
15th Jul 2018, 5:08 AM
Raphael Shay
Raphael Shay - avatar
+ 1
S. C. I have one question though. What does this line do: inputNumber = str(inputNumber)[1:]
15th Jul 2018, 5:23 AM
Raphael Shay
Raphael Shay - avatar
+ 1
Thanks, what else could I use and what's bad about them?
16th Jul 2018, 4:55 PM
Raphael Shay
Raphael Shay - avatar
0
󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸󠀸hu󠀸󠀸
12th Jul 2018, 2:06 PM
Addison “3master” Reilly
Addison “3master” Reilly - avatar