2022年6月13日
摘要: task3 1 from turtle import * 2 def square(size=50,rgb='pink'): 3 pencolor(rgb) 4 for i in range(4): 5 fd(size) 6 left(90) 7 def main(): 8 setup(800,60 阅读全文
posted @ 2022-06-13 20:11 VolcanX 阅读(3) 评论(0) 推荐(0) 编辑
  2022年6月7日
摘要: user.py 1 class User: 2 count=0 3 def __init__(self,name='guest',password='111111',status='1'): 4 User.count+=1 5 self.name=name 6 self.password=passw 阅读全文
posted @ 2022-06-07 11:41 VolcanX 阅读(19) 评论(1) 推荐(0) 编辑
  2022年5月19日
摘要: task3 1 def is_valid(x): 2 if len(x)==18: 3 if x.isdigit() or( x[:-1].isdigit() and x[-1]=='X'): 4 return True 5 else: 6 return False 7 else: 8 return 阅读全文
posted @ 2022-05-19 10:12 VolcanX 阅读(15) 评论(1) 推荐(0) 编辑
  2022年5月16日
摘要: task3 1 with open('data3.txt','r',encoding='utf-8') as f: 2 data=f.readlines() 3 f.close() 4 with open('data3_processed.txt','w',encoding='utf-8') as 阅读全文
posted @ 2022-05-16 20:19 VolcanX 阅读(27) 评论(3) 推荐(0) 编辑
  2022年5月4日
摘要: 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 sum=inc(7)+inc(7) 10 print(sum) 不是1.内置作用域2.全局作用域3.局部作用域 阅读全文
posted @ 2022-05-04 20:12 VolcanX 阅读(34) 评论(3) 推荐(0) 编辑
  2022年4月23日
摘要: 3.1 1 import random 2 print('用列表存储随机整数:') 3 Is=[random.randint(1,100)for i in range(5)] 4 print(Is) 5 6 print('\n用集合存储随机整数:') 7 s1={random.randint(1,1 阅读全文
posted @ 2022-04-23 13:41 VolcanX 阅读(15) 评论(3) 推荐(0) 编辑
  2022年4月11日
摘要: 1 x=list(range(10)) 2 print('整数输入1:',end='') 3 for i in x: 4 print(i,end=' ') 5 6 print('\n整数输出2: ', end = '') 7 for i in x: 8 print(f'{i:02d}',end='- 阅读全文
posted @ 2022-04-11 18:50 VolcanX 阅读(15) 评论(4) 推荐(0) 编辑
  2022年3月27日
摘要: (*总结在最后) 1 print('hey,u') 2 print('hey','u') 3 x,y,z=1,2,3 4 print(x,y,z) 5 print('x=%d,y=%d,z=%d'%(x,y,z)) 6 print('x={},y={},z={}'.format(x,y,z)) 7 阅读全文
posted @ 2022-03-27 22:12 VolcanX 阅读(34) 评论(3) 推荐(0) 编辑