+ 7
["SOLVED"]Python no output problem in SoloLearn
If the code has recursion or indirectly infinite while loop the program crashes and says no output. How to solve this!!! https://code.sololearn.com/cz6LSRO0xk7n/?ref=app
33 Answers
+ 13
Sololearn provides a limited time(2-4 sec) for your code to execute.
Your code is exceeding time limit during the execution of while loop only(it never reaches the breaking condition) thus last line is not getting printed.
You can add a print(i) statement inside the loop to find out till where your loop is running.
+ 9
Namit Jain count out the number of zeros in my k code compared with q&a2 which has pip 20.2.1 installed
+ 7
Why will it crash in such a small calculation?
https://code.sololearn.com/cW5kGulFsV2o/?ref=app
+ 6
Sebastian Pacurar BroFar Namit Jain Burey
I heard that SoloLearn only runs the code for 3-4 seconds.
How can I increase this time so that the code runs long enough?
+ 6
Can u explain this code pls.
https://code.sololearn.com/cWvcL31luuXj/?ref=app
It went way over my head. 😔😖😩
+ 5
🇧🇩Saadman Nuheen🇧🇩 as far as my knowledge goes you can't increase the time allocated to your code.
+ 5
🇧🇩Saadman Nuheen🇧🇩 I have already told you that you will have to decrease the calculations in order to make the process faster!
Like: if you don't know what's the answer of the code you have made then:
https://code.sololearn.com/cWvcL31luuXj/?ref=app
+ 4
🇧🇩Saadman Nuheen🇧🇩 you cannot increase this time
You will have to make out the shortest method to run your code
+ 3
Namit Jain Dude see the code that I gave.
https://code.sololearn.com/cz6LSRO0xk7n/?ref=app
+ 3
🇧🇩Saadman Nuheen🇧🇩 because you are dealing with a huge number the execution times out... here one optional way to look at this
https://code.sololearn.com/clgJfZ7Sin0n/?ref=app
here is k by itself or 1000 ** 10000
https://code.sololearn.com/cPgbas8lUWGt/?ref=app
+ 3
BroFar pls see your code again!
We want f > l
Why not use a library!
https://code.sololearn.com/cWvcL31luuXj/?ref=app
+ 3
Namit Jain the number asking for is beyond the scope here allowable... Think of it as trying to get the full pi and only having so many seconds to get it.
+ 3
BroFar but my code is able to find exact value of the number!
Pls have a look at my code as well
+ 3
Namit Jain it doesn't go deep enough and look again
https://code.sololearn.com/cq55rfX1BY0D/?ref=app
+ 3
Try numpy
import numpy as np
print(np.arange(1,10000000))
print('this will not print')
+ 3
BroFar I am printing the value of x and not the value of 1000**10000
Ok, if you want then try this
x = 10**30
print(x**1000)
print(1000**10000)
And count the number of zeros
You will find equal number of zeros
https://code.sololearn.com/c6xyaTln8JSw/?ref=app
If still any objections then come to dm and explain me! You are more experienced in py than me
+ 3
Namit Jain in your code titled "q/a", you can install pip version 20.2.2, u should install it😉
+ 3
JUNIOR but nothing is impossible 🙃
The answer is 10**30
https://code.sololearn.com/cWvcL31luuXj/?ref=app
+ 3
Coder .
Your while loop doesn't even run once.
Check the expression.
while i:
And the value of i at first is 0.
So the loop doesn't even run once.
So the last line is easily printed.
Anyways the problem is solved.
Happy coding.
edit: @coders ans has been deleted.
+ 2
won't reach deep enough Namit Jain look at k code above which reached limits and you are trying to find a number beyond those limits