12 2021 档案

摘要:1.判断闰年 编写程序判断输入的年是否为闰年。四年一闰;百年不闰,四百年再闰;千年不闰,四千年再闰。 选择结构的经典例题,关键在于对题目信息的整合,意识到千年和四千年的条件都是百年和四百年的子集。 a=int(input()) if a%4==0 and a%100!=0: #先描述出题目对于闰年的 阅读全文
posted @ 2021-12-23 21:21 JS_Pierre 阅读(429) 评论(1) 推荐(1)
摘要:可视化去你妈的 1 import matplotlib.pyplot as plt 2 import numpy as np 3 def label(x): 4 sinx = np.sin(x) 5 cosx = np.cos(x) 6 plt.plot(x,cosx,color="blue",ma 阅读全文
posted @ 2021-12-16 20:43 JS_Pierre 阅读(117) 评论(0) 推荐(0)
摘要:T1 程序:编写Python程序以读取和打印``egypt.txt''文件中的每一行。 下面给出了” egypt.txt”文件的示例内容。 Printing each line in the text file Ancient Egypt was an ancient civilization of 阅读全文
posted @ 2021-12-02 23:23 JS_Pierre 阅读(122) 评论(0) 推荐(0)