摘要: task1_1 实验源码 from turtle import * def move(x, y): penup() goto(x, y) pendown() def draw(n, size = 100): for i in range(n): fd(size) left(360/n) def ma 阅读全文
posted @ 2023-06-11 16:53 Praying7 阅读(4) 评论(0) 推荐(0) 编辑
摘要: task6 实验源码 # 读取并处理原始数据with open('data6.csv','r',encoding = 'gbk') as f: old_data = f.read().split('\n') del old_data[0] # 四舍五入得到新数据 new_data = [] for 阅读全文
posted @ 2023-06-06 16:15 Praying7 阅读(4) 评论(0) 推荐(0) 编辑
摘要: task 1 实验源码 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 10 sum = inc(7) + inc(7) 11 print(sum) 运行结果截图 阅读全文
posted @ 2023-05-22 16:22 Praying7 阅读(23) 评论(0) 推荐(0) 编辑
摘要: task 1 实验源码 1 import random 2 3 print('用列表存储随机整数: ') 4 lst = [random.randint(0, 100) for i in range(5)] 5 print(lst) 6 7 print('\n用集合存储随机整数: ') 8 s1 = 阅读全文
posted @ 2023-04-21 16:25 Praying7 阅读(12) 评论(0) 推荐(0) 编辑
摘要: task1 实验源码 #字符串的基础操作 x = 'nba FIFA' print(x.upper()) print(x.lower()) print(x.swapcase()) print() x = 'abc' print(x.center(10, '*')) print(x.ljust(10, 阅读全文
posted @ 2023-03-23 14:30 Praying7 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 实验任务1 task1_1 程序源码 #task1_1 print输出的几种用法 #用法1:用于输出单个字符串或单个变量 print('hey, u') #用法2:用于输出多个数据项,用逗号分隔 print('hey','u') x,y,z = 1,2,3 print(x,y,z) #用法3:用于混 阅读全文
posted @ 2023-03-09 15:06 Praying7 阅读(27) 评论(1) 推荐(1) 编辑