摘要: from turtle import * def square(size=50, rgb = 'orange'): pencolor(rgb) for i in range(4): fd(size) left(90) for i in range(11): square(80) left(360/1 阅读全文
posted @ 2021-06-11 16:45 AIDEN_WU 阅读(32) 评论(2) 推荐(0)
摘要: class StudentDoc: def __init__(self,studentnumber,name,major,point): self._studentnumber = studentnumber self._name = name self._major = major self._p 阅读全文
posted @ 2021-05-25 17:08 AIDEN_WU 阅读(30) 评论(1) 推荐(0)
摘要: f = open(r'data6_1.txt') f1=open('data6_2.txt','w') a = list(f) a.sort(key=lambda x : x[8:]) a.reverse() for i in a: i=i.strip('\n') f1.write(''.join( 阅读全文
posted @ 2021-05-18 12:31 AIDEN_WU 阅读(37) 评论(0) 推荐(0)
摘要: f = open(r'data6_1.txt') f1=open('data6_2.txt','w') a = list(f) a.sort(key=lambda x : x[8:]) a.reverse() for i in a: i=i.strip('\n') f1.write(''.join( 阅读全文
posted @ 2021-05-11 17:26 AIDEN_WU 阅读(26) 评论(0) 推荐(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: 阅读全文
posted @ 2021-04-22 22:28 AIDEN_WU 阅读(45) 评论(0) 推荐(0)
摘要: x1,y1=1.2,3.57 x2,y2=2.26,8.7 print('{:-^40}'.format('输出一')) print('x1={},y1={}'.format(x1,y1)) print('x2={},y2={}'.format(x2,y2)) print('{:-^40}'.for 阅读全文
posted @ 2021-04-05 13:21 AIDEN_WU 阅读(50) 评论(0) 推荐(0)
摘要: name_list=[] for i in range(3): x = input('输入想要加入愿望清单的事情') name_list.append(x) print('{:-^40}'.format('我的愿望清单')) n=1 for name in name_list: print(f'{n 阅读全文
posted @ 2021-04-02 17:32 AIDEN_WU 阅读(37) 评论(0) 推荐(0)
摘要: list = ['david bowie', 'louis armstrong', 'leonard cohen', 'bob dylan', 'cocteau twins'] name_list=sorted(list) n=1 for name in name_list: print(f'{n} 阅读全文
posted @ 2021-04-02 17:23 AIDEN_WU 阅读(17) 评论(0) 推荐(0)
摘要: file_name ="file.txt" line_counts =0 word_counts =0 character_counts =0 with open(file_name, 'r')as f: for line in f: words = line.split() line_counts 阅读全文
posted @ 2021-04-02 17:15 AIDEN_WU 阅读(25) 评论(0) 推荐(0)
摘要: name_list = ['pink Floyd', 'kanye West', 'david bowie', 'bob dylan', 'radiohead'] n = 1 for name in name_list: print(f'{n}: {name.title()}') n += 1 阅读全文
posted @ 2021-04-02 17:13 AIDEN_WU 阅读(35) 评论(0) 推荐(0)