python回归之旅-用python学习数学---2023-002
首先使用win10下的anaconda,运行没有问题。
import math
def f(x):
return math.sqrt(x+3)-x+1
def g(x):
return x*x-1
def h(x):
return x*x+1/x+2
for x in [0.5,1,math.sqrt(2),math.sqrt(2)-1]:
print("f({:.3f})={:,.3f}".format(x,f(x)))
print("g({:.3f})={:,.3f}".format(x,g(x)))
print("h({:.3f})={:,.3f}".format(x,h(x)))
--------------------------------------------------------
貌似只是使用了math模块,已经有了。(所以问题不大)
import math
import matplotlib.pyplot as plt
from turtle import *
forward(100)
shape('turtle')
-------------------------------------------------------
matplotlib 和 turtle模块已经安装成功,没有问题。
import math
import matplotlib.pyplot as plt
from turtle import *
shape('turtle')
def square():
for i in range(4):
forward(100)
right(90)
def draw(x):
for i in range(x):
square()
right(5)
draw(60)

函数调用,turtle简单画画没有问题。

