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.. | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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..

26th Aug 2017, 5:34 AM
Sivapratap Reddy
Sivapratap Reddy - avatar
3 Respostas
+ 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)
26th Aug 2017, 5:54 AM
GAWEN STEASY
GAWEN STEASY - avatar
+ 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
26th Aug 2017, 6:19 AM
David Ashton
David Ashton - avatar
26th Aug 2017, 5:53 AM
Jonas Schrƶter
Jonas Schrƶter - avatar