2022年6月14日

实验8

摘要: task3 1 from turtle import* 2 3 def square(size=50,rgb='orange'): 4 pencolor(rgb) 5 for i in range(4): 6 fd(size) 7 left(90) 8 9 def main(): 10 setup( 阅读全文

posted @ 2022-06-14 09:19 蒜头小兲 阅读(18) 评论(0) 推荐(0) 编辑

2022年6月6日

实验七

摘要: class User: count=0 def __init__(self,name='guest',password='111111',status=1): User.count+=1 self.name=name self.password=password self.status=status 阅读全文

posted @ 2022-06-06 00:25 蒜头小兲 阅读(14) 评论(0) 推荐(0) 编辑

2022年5月22日

实验6

摘要: task3 1 def is_valid(s): 2 if len(s)!=18: 3 return False 4 elif s.isdigit() is False: 5 for i in s: 6 if i<='9' and i>='0': 7 continue 8 elif i<='Z' a 阅读全文

posted @ 2022-05-22 13:39 蒜头小兲 阅读(24) 评论(2) 推荐(0) 编辑

2022年5月16日

实验5

摘要: task3 1 with open('data3.txt','r+',encoding='utf-8')as f: 2 a=[] 3 for i in f: 4 i=i.strip('\n') 5 a.append(i) 6 a.pop(0) 7 b=[eval(i) for i in a] 8 p 阅读全文

posted @ 2022-05-16 09:22 蒜头小兲 阅读(17) 评论(2) 推荐(0) 编辑

2022年5月11日

实验四

摘要: task1 1 print(sum) 2 sum=42 3 print(sum) 4 5 def inc(n): 6 sum=n+1 7 print(sum) 8 return sum 9 10 sum=inc(7)+inc(7) 11 print(sum) 答:不是代表一个变量名。 1.Built 阅读全文

posted @ 2022-05-11 00:12 蒜头小兲 阅读(21) 评论(1) 推荐(0) 编辑

2022年4月23日

实验3

摘要: task1 1 import random 2 print('用列表存储随机整数:') 3 ls=[random.randint(1,100) for i in range(5)] 4 print(ls) 5 6 print('\n用集合存储随机整数:') 7 s1={random.randint( 阅读全文

posted @ 2022-04-23 14:37 蒜头小兲 阅读(35) 评论(4) 推荐(0) 编辑

2022年4月11日

实验2

摘要: task1 1 x=list(range(10)) 2 3 print('整数输出1:',end='') 4 for i in x: 5 print(i,end=' ') 6 7 print('\n整数输出2:',end='') 8 for i in x: 9 print(f'{i:02d}',en 阅读全文

posted @ 2022-04-11 01:15 蒜头小兲 阅读(26) 评论(0) 推荐(0) 编辑

2022年3月26日

实验1

摘要: 实验任务1task1_1 1 print('hey,u') 2 3 print('hey','u') 4 x,y,z=1,2,3 5 print(x,y,z) 6 7 print('x=%d,y=%d,z=%d'%(x,y,z)) 8 print('x={},y={},z={}'.format(x, 阅读全文

posted @ 2022-03-26 20:18 蒜头小兲 阅读(23) 评论(2) 推荐(0) 编辑

导航