2022年6月14日

摘要: task3.py 1 from turtle import * 2 3 def square(size=50, rgb='orange'): 4 '''绘制正方形 5 参数size指定边长 6 参数rgb指定画笔颜色 7 如果没有给参数,采用默认值 8 ''' 9 pencolor(rgb) 10 阅读全文
posted @ 2022-06-14 00:29 夜炫川 阅读(8) 评论(1) 推荐(0) 编辑

2022年6月7日

摘要: user.py 1 class User(): 2 def __init__(self,name="guest",password='111111',status=1): 3 self._name=name 4 self._password=password 5 self._status=statu 阅读全文
posted @ 2022-06-07 22:15 夜炫川 阅读(11) 评论(2) 推荐(0) 编辑

2022年5月25日

摘要: task3.py 1 def is_valid(m): 2 if len(m)==18 and m.isdigit(): 3 return 'True' 4 elif len(m)==18 and m[-1]=='X': 5 return 'True' 6 else: 7 return 'False 阅读全文
posted @ 2022-05-25 18:15 夜炫川 阅读(9) 评论(3) 推荐(0) 编辑

2022年5月16日

摘要: task3.py 1 with open('data3.txt', 'r', encoding='utf-8') as f: 2 data = f.read().split('\n') 3 yuanshishuju = data.pop(0) 4 data1 = [eval(i) for i in 阅读全文
posted @ 2022-05-16 21:25 夜炫川 阅读(17) 评论(2) 推荐(0) 编辑

2022年4月27日

摘要: task1.py 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 = {rando 阅读全文
posted @ 2022-04-27 11:07 夜炫川 阅读(19) 评论(4) 推荐(0) 编辑

2022年4月13日

摘要: task1.py 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 阅读全文
posted @ 2022-04-13 11:22 夜炫川 阅读(23) 评论(7) 推荐(0) 编辑

2022年3月28日

摘要: task1_1.py 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 = {}, 阅读全文
posted @ 2022-03-28 22:39 夜炫川 阅读(30) 评论(5) 推荐(0) 编辑
 
摘要: 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 = {}' 阅读全文
posted @ 2022-03-28 21:57 夜炫川 阅读(10) 评论(1) 推荐(0) 编辑