33 AnswersNew Answer
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.
Namit Jain count out the number of zeros in my k code compared with q&a2 which has pip 20.2.1 installed
Why will it crash in such a small calculation? https://code.sololearn.com/cW5kGulFsV2o/?ref=app
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?
Can u explain this code pls. https://code.sololearn.com/cWvcL31luuXj/?ref=app It went way over my head. 😔😖😩
🇧🇩Saadman Nuheen🇧🇩 as far as my knowledge goes you can't increase the time allocated to your code.
🇧🇩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
🇧🇩Saadman Nuheen🇧🇩 you cannot increase this time You will have to make out the shortest method to run your code
Namit Jain Dude see the code that I gave. https://code.sololearn.com/cz6LSRO0xk7n/?ref=app
🇧🇩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
BroFar pls see your code again! We want f > l Why not use a library! https://code.sololearn.com/cWvcL31luuXj/?ref=app
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.
BroFar but my code is able to find exact value of the number! Pls have a look at my code as well
Namit Jain it doesn't go deep enough and look again https://code.sololearn.com/cq55rfX1BY0D/?ref=app
Try numpy import numpy as np print(np.arange(1,10000000)) print('this will not print')
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
Namit Jain in your code titled "q/a", you can install pip version 20.2.2, u should install it😉
JUNIOR but nothing is impossible 🙃 The answer is 10**30 https://code.sololearn.com/cWvcL31luuXj/?ref=app
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.
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