摘要: task3.py from turtle import * def square(size=50, rgb='orange'): '''绘制正方形 参数size指定边长 参数rgb指定画笔颜色 如果没有给参数,采用默认值 ''' pencolor(rgb) for i in range(4): fd 阅读全文
posted @ 2022-06-13 17:35 h_ln 阅读(9) 评论(1) 推荐(0) 编辑
摘要: user.py class User(): def __init__(self,name="guest",password='111111',status=1): self._name=name self._password=password self._status=status def defi 阅读全文
posted @ 2022-06-07 20:58 h_ln 阅读(11) 评论(1) 推荐(0) 编辑
摘要: task3.py def is_valid(m): if len(m)==18 and m.isdigit(): return 'True' elif len(m)==18 and m[-1]=='X': return 'True' else: return 'False' with open('d 阅读全文
posted @ 2022-05-24 16:04 h_ln 阅读(6) 评论(0) 推荐(0) 编辑
摘要: task3.py with open('data3.txt', 'r', encoding='utf-8') as f: data = f.read().split('\n') yuanshishuju = data.pop(0) data1 = [eval(i) for i in data] da 阅读全文
posted @ 2022-05-15 22:16 h_ln 阅读(5) 评论(3) 推荐(0) 编辑
摘要: 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) 不是 第一次:Build-in 第二次:Global 第三次: 阅读全文
posted @ 2022-05-09 22:07 h_ln 阅读(6) 评论(1) 推荐(0) 编辑
摘要: 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-25 23:09 h_ln 阅读(19) 评论(4) 推荐(0) 编辑
摘要: task1.py 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 = 阅读全文
posted @ 2022-04-12 22:22 h_ln 阅读(12) 评论(4) 推荐(0) 编辑
摘要: 四、实验结论 1.实验任务1 task1_1.py print('hey, u') print('hey', ' u') x,y,z = 1,2,3 print(x, y, z) print('x = %d, y = %d, z = %d' %(x,y,z)) print('x = {}, y = 阅读全文
posted @ 2022-03-28 21:44 h_ln 阅读(22) 评论(5) 推荐(0) 编辑
摘要: https://www.cnblogs.com/linan-h/ 阅读全文
posted @ 2022-03-28 19:46 h_ln 阅读(6) 评论(0) 推荐(0) 编辑