摘要: task 3 from turtle import* def square(size=50,rgb='orange'): pencolor(rgb) for i in range(4): fd(size) left(90) def main(): setup (800,600) speed(0) f 阅读全文
posted @ 2022-06-14 10:49 周易潇 阅读(21) 评论(2) 推荐(0) 编辑
摘要: class User: def __init__(self,name='guest',password=111111,status=1): self.name=name self.password=password self.status=status def info(self): print(' 阅读全文
posted @ 2022-06-07 19:22 周易潇 阅读(8) 评论(2) 推荐(0) 编辑
摘要: task3 def is_valid(x): if len(x)!=18: return False else: if x.isdecimal(): return True elif x.find('X')and x.strip('X').isdecimal(): return True else: 阅读全文
posted @ 2022-05-25 13:21 周易潇 阅读(12) 评论(2) 推荐(0) 编辑
摘要: task3 with open('C:/Users/dell/Desktop/实验5数据文件/data3.txt','r+',encoding='utf_8')as f: a=[] b=[] for line in f.readline(): line=line.strip('\n') a.appe 阅读全文
posted @ 2022-05-16 21:27 周易潇 阅读(42) 评论(2) 推荐(0) 编辑
摘要: 实验任务1 print(sum) sum=42 print(sum) def inc(n): sum=n+1 print(sum) return sum sum=inc(7)+inc(7) print(sum) Q:不是 line1:line1之前 line2:line2-3 line7:line6 阅读全文
posted @ 2022-05-11 15:26 周易潇 阅读(14) 评论(2) 推荐(0) 编辑
摘要: 实验3 task3_1 import random print('用列表存储随机整数:') ls=[random.randint(1,100) for i in range(5)] print(ls) print('\n用集合存储随机整数:') s1={random.randint(1,100) f 阅读全文
posted @ 2022-04-24 23:30 周易潇 阅读(25) 评论(1) 推荐(0) 编辑
摘要: 实验任务1 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整数 阅读全文
posted @ 2022-04-13 09:51 周易潇 阅读(25) 评论(3) 推荐(0) 编辑