Error in user YAML: (<unknown>): found a tab character that violate indentation while scanning a plain scalar at line 3 column 3
---
- oeasy Python 0795
- 这是 oeasy 系统化 Python 教程,从基础一步步讲,扎实、完整、不跳步。愿意花时间学,就能真正学会。
- 本教程同步发布在:
- 个人网站: `https://oeasy.org`
- 蓝桥云课: `https://www.lanqiao.cn/courses/3584`
- GitHub: `https://github.com/overmind1980/oeasy-python-tutorial`
- Gitee: `https://gitee.com/overmind1980/oeasypython`
---import numpy as np
import matplotlib.pyplot as plt
# 定义一元二次方程函数
def quadratic_equation(x):
return x**2 + 3*x - 5
# 生成x轴上的点
x = np.linspace(-10, 10, 100)
y = [quadratic_equation(i) for i in x]
# 绘制曲线图
plt.plot(x, y)
plt.title('Quadratic Equation')
plt.xlabel('X')
plt.ylabel('Y')
plt.grid()
plt.show()
- 本文来自 oeasy Python 系统教程。
- 想完整、扎实学 Python,
- 搜索 oeasy 即可。