2022年6月13日
摘要: task3.py 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( 阅读全文
posted @ 2022-06-13 15:06 好运来。 阅读(26) 评论(1) 推荐(0) 编辑
  2022年6月5日
摘要: user.py class User: def __init__(self, name='guest', password=111111, status=1): self.name = name self.password = password self.status = status def in 阅读全文
posted @ 2022-06-05 12:22 好运来。 阅读(44) 评论(2) 推荐(0) 编辑
  2022年5月22日
摘要: task3.py def is_valid(n): if len(n) == 18: if (n.isdigit()) or (n[:-1].isdigit() and n[-1] == 'X'): return True else: return False else: return False 阅读全文
posted @ 2022-05-22 15:46 好运来。 阅读(20) 评论(2) 推荐(0) 编辑
  2022年5月15日
摘要: task3.py with open('data3.txt','r',encoding= 'utf-8') as f: data = f.readlines() d = [eval(line) for line in data[1:]] print('原始数据: ') print(d) t = [] 阅读全文
posted @ 2022-05-15 15:28 好运来。 阅读(31) 评论(2) 推荐(0) 编辑
  2022年5月7日
摘要: task1.py print(sum)sum = 42 print(sum) def inc(n): sum = n+1 print(sum) return sum sum = inc(7) + inc(7) print(sum) 不是line1:内置函数line3:赋值给予的数line7:局部变量 阅读全文
posted @ 2022-05-07 19:34 好运来。 阅读(30) 评论(2) 推荐(0) 编辑
  2022年4月23日
摘要: task1.py import random print('用列表存储随机整数: ') ls = [random.randint(1, 100) for i in range(5)] print(ls) print('\n用集合存储随机整数: ') s1 = {random.randint(1,10 阅读全文
posted @ 2022-04-23 12:53 好运来。 阅读(37) 评论(2) 推荐(0) 编辑
  2022年4月11日
摘要: task1.pyx = 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='-') p 阅读全文
posted @ 2022-04-11 22:55 好运来。 阅读(31) 评论(3) 推荐(0) 编辑
  2022年3月27日
摘要: task1_1.py print('hey, u')print('hey', ' u')x,y,z = 1,2,3print(x, y, z)print('x = %d, y = %d, z = %d'%(x,y,z))print('x = {}, y = {}, z = {}'.format(x, 阅读全文
posted @ 2022-03-27 20:38 好运来。 阅读(50) 评论(3) 推荐(0) 编辑