Python : name 'math' is not defined Error?

前端 未结 4 2082
Happy的楠姐
Happy的楠姐 2021-01-01 09:29

I am a beginner in python and cant understand why this is happening:

from math import *
print \"enter the number\"
n=int(raw_input())
d=2
s=0
while d

        
4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-01 09:59

    How about (when you need only math.pi):

    from math import pi as PI
    

    and then use it like PI symbol?

提交回复
热议问题