+ 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

20th Dec 2018, 1:59 PM
Jacob Heath
Jacob Heath - avatar
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! 😊
20th Dec 2018, 2:29 PM
Kishalaya Saha
Kishalaya Saha - avatar
+ 3
thanks! Now it works.
21st Dec 2018, 1:19 PM
Jacob Heath
Jacob Heath - avatar
0
You're welcome, Jacob! 😊
21st Dec 2018, 1:31 PM
Kishalaya Saha
Kishalaya Saha - avatar