摘要:
Task3.py from turtle import * def square(size=50, rgb=(1,0.7,0)): '''绘制正方形 参数size指定边长 参数rgb指定画笔颜色 如果没有给参数,采用默认值 ''' pencolor(rgb) for i in range(4): f 阅读全文
摘要:
Task 3.py def is_valid(id): if len(id) != 18: return False try: for i in id: if i == 'X': continue elif type(eval(i)) == int: continue else: return Fa 阅读全文
摘要:
Task 3.py with open('data3.txt', 'r', encoding='utf-8') as f: data = f.read().strip() a = data.split('\n') y = a.pop(0) b = [] for i in a: x = eval(i) 阅读全文
摘要:
task 1.py import random print('用列表存储随机整数: ') ls = [random.randint(1, 100) for i in range(5)] print(ls) print('\n用集合存储随机整数: ') s1 = {random.randint(1,1 阅读全文
摘要:
task 1.py 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 阅读全文