0

python problem. import 'math' print('math.pi')

help me figure it out, python In the examples in the book, all code is written in the console > _. ... I do not have a console, I write code on an Android phone, and I only have an editor that does not run the code for the console. More than one code presented in the book does not work in this editor, tell me what to do, maybe I need to write the code differently? import math; math pi; Entering twice enter, and then everything works well for me, but if I write the same thing in an editor whose lines are already numbered like this: 1 import math; 2 math pi; launch, then I give the error is that I am writing the wrong syntax. Tell me what's the matter? in my book from which I study all examples are given and written in the consolebut I don't have a console but only a code editor and this code doesn't work on it at all. Please explain to me what is the problem? Auto installing libraries... --> main.py File "main.py", line 1 import ('math')print( ^ SyntaxError: invalid syntax

7th Nov 2020, 7:55 PM
<AlexID>
<AlexID> - avatar
3 Respostas
+ 2
import math print(math.pi)
7th Nov 2020, 8:37 PM
Yurii Ostapenko
Yurii Ostapenko - avatar
+ 2
it cannot fail to work. this is the simplest code that even my cat can write🤣 https://code.sololearn.com/cC3Lsl3dPBS0/?ref=app
8th Nov 2020, 10:59 AM
Yurii Ostapenko
Yurii Ostapenko - avatar
- 1
your options don't work
8th Nov 2020, 10:47 AM
<AlexID>
<AlexID> - avatar