说出5个你知道的python外置库
时间: 2024-05-21 19:14:33 浏览: 9
1. NumPy:用于数学运算,特别是大型、多维数组和矩阵操作。
2. Pandas:用于数据分析和处理,特别是表格化数据。
3. Matplotlib:用于绘制统计图形和其他类型的图形。
4. Scikit-learn:用于机器学习和统计建模。
5. TensorFlow:用于深度学习和神经网络建模。
相关问题
python外置库有哪些
Python 的外置库非常丰富,以下是一些常用的外置库:
1. NumPy:用于科学计算的基础库,提供了高效的数组操作和数学函数。
2. Pandas:用于数据处理和分析的库,能够处理各种数据格式。
3. Matplotlib:绘制图表和数据可视化的库。
4. Scikit-learn:用于机器学习的库,包含了各种经典的机器学习算法。
5. TensorFlow:谷歌开发的机器学习框架,用于构建深度学习模型。
6. PyTorch:Facebook 开发的机器学习框架,同样用于构建深度学习模型。
7. Django:用于 Web 开发的框架,提供了强大的数据库支持和模板引擎。
8. Flask:轻量级的 Web 开发框架,适合快速构建简单的 Web 应用。
9. Requests:用于 HTTP 请求的库,可以方便地发送 HTTP 请求和处理响应。
10. Beautiful Soup:用于解析 HTML 和 XML 文档的库,可以快速提取所需信息。
11. Pygame:用于游戏开发的库,提供了图形和声音处理的功能。
12. OpenCV:用于计算机视觉和图像处理的库,可以处理图像和视频。
还有很多其他的外置库,可以根据需要选择使用。
不引入外置库用python写一个学生成绩管理系统
好的,我可以帮您实现一个简单的学生成绩管理系统。首先,我们需要定义一个学生类,包含姓名、学号、每门课程的成绩等属性。然后,我们可以通过命令行交互的方式来实现增加学生、查询学生信息、修改学生成绩等功能。
以下是代码实现:
```python
class Student:
def __init__(self, name, student_id, scores=None):
self.name = name
self.student_id = student_id
if scores:
self.scores = scores
else:
self.scores = {}
def add_score(self, subject, score):
self.scores[subject] = score
def get_score(self, subject):
return self.scores.get(subject, None)
def get_scores(self):
return self.scores
students = []
def add_student():
name = input("请输入学生姓名:")
student_id = input("请输入学号:")
student = Student(name, student_id)
students.append(student)
print("添加学生成功!")
def query_student():
student_id = input("请输入学号:")
for student in students:
if student.student_id == student_id:
print("姓名:{},学号:{},成绩:{}".format(student.name, student.student_id, student.get_scores()))
break
else:
print("未查询到该学生!")
def modify_score():
student_id = input("请输入学号:")
for student in students:
if student.student_id == student_id:
subject = input("请输入科目:")
score = input("请输入成绩:")
student.add_score(subject, score)
print("修改成绩成功!")
break
else:
print("未查询到该学生!")
while True:
print("欢迎使用学生成绩管理系统!请选择操作:")
print("1. 添加学生")
print("2. 查询学生信息")
print("3. 修改学生成绩")
print("4. 退出系统")
choice = input()
if choice == '1':
add_student()
elif choice == '2':
query_student()
elif choice == '3':
modify_score()
elif choice == '4':
print("谢谢使用,再见!")
break
else:
print("输入有误,请重新输入!")
```
您可以将以上代码保存为一个.py文件,然后在命令行中运行即可。
相关推荐
![py](https://img-home.csdnimg.cn/images/20210720083646.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)