摘要: from turtle import* def sq(size=50,rgb='orange'): pencolor(rgb) for i in range(4): fd(size) left(90) def main(): setup(800,600) speed(0) for i in rang 阅读全文
posted @ 2021-06-11 17:06 阿巴阿巴阿巴巴啊 阅读(48) 评论(3) 推荐(0)
摘要: '''student.py''' class StudentDoc: '''学生档案管理''' def __init__(self,students_number,studens_name,major,python_score): self._students_number=students_num 阅读全文
posted @ 2021-05-30 22:44 阿巴阿巴阿巴巴啊 阅读(56) 评论(2) 推荐(0)
摘要: #统计文件data1_1.txt行数(不包括空白行)#data1_1.txt中的空白行都是由\n构成的#task1_1.py with open('data1_1.txt','r',encoding='utf-8') as f : data=f.readlines() #一次读入所有数据,按行读取, 阅读全文
posted @ 2021-05-16 16:40 阿巴阿巴阿巴巴啊 阅读(73) 评论(2) 推荐(0)
摘要: 思考题 1.random(1,100)包括100 而range(1,100)不包括100 2.len(s)不一定是5,可能会有4 实验2 x=[0,1]a=0b=1c=a+bj=0while c<1000: x.append(c) a=b b=c c=a+bfor i in x: print('{: 阅读全文
posted @ 2021-04-22 22:43 阿巴阿巴阿巴巴啊 阅读(150) 评论(2) 推荐(0)
摘要: 2.1x1,y1=1.2,3.57x2,y2=2.26,8.7print('x1={},y1={}'.format(x1,y1))print('x2={},y2={}'.format(x2,y2))print ('x1={:.1f},y1={:.1f}'.format(x1,y1))print (' 阅读全文
posted @ 2021-04-05 14:47 阿巴阿巴阿巴巴啊 阅读(124) 评论(3) 推荐(0)