PYTHON 入门
入门练习
print('hello world!')
hello world!
#variable
PI=3.1415926
myString='is a mathematic circular constant'
print(PI,myString)
3.1415926 is a mathematic circular constant
# -*- coding utf-8 -*-
#math模块举例:求解一元二次方程
import math
a=1
b=5
c=6
x1=(-b+math.sqrt(b*b-4*a*c))/(a*2)
x2=(-b-math.sqrt(b*b-4*a*c))/(a*2)
print('方程解为:',x1,x2)
方程解为: -2.0 -3.0