0
How to do mathematical operations in this app? I am not able to get output if write a code >>>2+3 and pressing run command..
3 Réponses
+ 4
in python you just do like that
t = input("Enter a num:")
a = input("Enter a num:")
print(int(t) + int(a))
or
print (2+3)
+ 1
I see you are learning Python.
If you're in the Python console (e.g. using IDLE on a PC where the prompt is '>>>'), all you have to do is hit 'enter', so
>>>2+3
5
>>>
If you're in the Code Playground, then do what @Gawen said, e.g.
type:
print(2 + 3)
press 'run'
you should get:
5
Make sure you aren't typing '>>>' as part of the code :)
If you do, you will get:
File "..\Playground\", line 1
>>>print(2+3)
^
SyntaxError: invalid syntax