+ 3
What is up with my code showing Time Limit Exceeded?
My code Mathematica https://code.sololearn.com/c6rC9o4YX26E/?ref=app Can anyone please tell me how to fix the code to print 2 with the input 1+1
3 odpowiedzi
+ 3
Hi Jacob Heath , and welcome to Sololearn!
It should look like this:
SUM = input()
if SUM == ("1+1"):
print ("2")
Putting "SUM" inside input makes it a prompt text for the user, just like "Please enter something". But SUM=input() stores the input in a variable SUM, which is what you want. You also missed a colon at the end of line 4.
And the Code Playground was down for quite a while, which is why you're getting the Time Limit Exceeded. Otherwise it would have shown you more specific errors.
Hope that helps. Happy learning! 😊
+ 3
thanks! Now it works.
0
You're welcome, Jacob! 😊