摘要: Exp6 turtles task3 from turtle import * # 绘制正方形 # 参数size指定边长,rgb指定画笔颜色 # 如果没有给参数,采用默认值 def square(size=50, rgb = 'orange'): pencolor(rgb) for i in ran 阅读全文
posted @ 2021-06-07 21:14 Dustella 阅读(109) 评论(2) 推荐(0)
摘要: 阅读全文
posted @ 2021-06-01 15:12 Dustella 阅读(38) 评论(0) 推荐(0)
摘要: ![](https://img2020.cnblogs.com/blog/2335293/202105/2335293-20210525164510469-1376714127.png) 阅读全文
posted @ 2021-05-25 16:45 Dustella 阅读(19) 评论(0) 推荐(0)
摘要: 实验5 类和模块 Task 5 Stuent.py 中模块实现 class StudentDoc: def __init__(self,num:int, name:str='Null', major:str='Unkown', grade:int=1) -> None: ''' 说明: * 创建一个 阅读全文
posted @ 2021-05-24 23:34 Dustella 阅读(113) 评论(2) 推荐(0)
摘要: 实验四 文件等的处理 任务六 with open('data6_1.txt','r',encoding='utf-8') as f: ls=sorted([line.replace('\n','').split('\t') for line in f.readlines()],key=lambda 阅读全文
posted @ 2021-05-11 16:14 Dustella 阅读(75) 评论(2) 推荐(1)
摘要: 1-1 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 @ 2021-04-16 16:47 Dustella 阅读(72) 评论(1) 推荐(0)
摘要: 实验1 # print输出的几种用法 # 用法1:用于输出单个字符串或单个变量 print('hey, u') # 用法2: 用于输出多个数据项,用逗号分隔 print('hey', ' u') x = 1 y = 2 z = 3 print(x, y, z) # 用法3: 用户混合字符串和变量值 阅读全文
posted @ 2021-04-02 18:27 Dustella 阅读(40) 评论(0) 推荐(0)
摘要: 实验2 任务1 x1,y1=1.2,3.57 x2,y2=2.26,8.7 # 输出1 print('{:-^40}'.format('输出1')) # 这样可以输出-分割线,输出1字符居中 print('x1={},y1={}'.format(x1,y1)) print('x2={},y2={}' 阅读全文
posted @ 2021-04-02 17:19 Dustella 阅读(60) 评论(1) 推荐(0)
点击右上角即可分享
微信分享提示