摘要: from turtle import * from random import random def square(size=50, rgb = tuple(random() for i in range(3))): pencolor(rgb) for i in range(4): fd(size) 阅读全文
posted @ 2021-06-11 17:31 yyyl 阅读(29) 评论(1) 推荐(0) 编辑
摘要: import student u1 = student.self('111','jake','生态','92') u1.change_point(100) u1.info() u2 = student.self('222','det','生态','95') u2.info() class Stude 阅读全文
posted @ 2021-05-31 15:04 yyyl 阅读(44) 评论(1) 推荐(0) 编辑
摘要: with open('data7.txt','r') as f: x=[] m=f.readlines() y=int(input('输入随机抽点人数:')) import random i=0 while i<y: n=random.randint(1,80) a=m[n] print(a.str 阅读全文
posted @ 2021-05-18 09:58 yyyl 阅读(26) 评论(1) 推荐(0) 编辑
摘要: x=list(range(10)) print('整数输出1:',end='') for i in x: print(i,end='') print('/n整数输出2:',end='') for i in x: print(f'{i:02d}',end='-') print('/n整数输出3',en 阅读全文
posted @ 2021-04-23 13:25 yyyl 阅读(92) 评论(1) 推荐(0) 编辑
摘要: x=list(range(10)) print('整数输出1:',end='') for i in x: print(i,end='') print('/n整数输出2:',end='') for i in x: print(f'{i:02d}',end='-') print('/n整数输出3',en 阅读全文
posted @ 2021-04-23 13:08 yyyl 阅读(45) 评论(1) 推荐(0) 编辑
摘要: def fun(n): if n <=1: return n else:return fun(n-1)+fun(n-2) for n in range(17): print(fun(n)) m=1 for n in [fun(n)]: print(f'{n:4d}',end=' 'if m%5 el 阅读全文
posted @ 2021-04-23 13:07 yyyl 阅读(43) 评论(1) 推荐(0) 编辑
摘要: import random x=random.randint(1,31) y=eval(input('猜猜2021年5月哪一天会是你的幸运日/n你有三次机会,猜吧')) if x==y: print('lucky day') else: i=0 while i<2: if y==x: print(' 阅读全文
posted @ 2021-04-23 12:52 yyyl 阅读(40) 评论(1) 推荐(0) 编辑
摘要: print('hey','you') print('hey','you') x=1 y=2 z=3 print(x,y,z) print('x=%d,y=%d,z=%d'%(x,y,z)) print('x={},y={},z={}'.format(x,y,z)) print(f'x={x},y={ 阅读全文
posted @ 2021-04-02 17:26 yyyl 阅读(90) 评论(3) 推荐(0) 编辑