摘要: 实验任务1 1 class Account: 2 def __init__(self,name,account_number,initial_amount = 10): 3 self._name = name 4 self._card_no = account_number 5 self._bala 阅读全文
posted @ 2023-06-13 16:34 ‘_‘ 阅读(26) 评论(0) 推荐(0)
摘要: 实验任务1 task1-1 1 from turtle import * 2 def move(x, y): 3 penup() 4 goto(x, y) 5 pendown() 6 def draw(n, size = 100): 7 for i in range(n): 8 fd(size) 9 阅读全文
posted @ 2023-06-12 10:06 ‘_‘ 阅读(31) 评论(0) 推荐(0)
摘要: 实验任务6 1 # 读取并处理原始数据with open('data6.csv','r',encoding = 'gbk') as f: 2 old_data = f.read().split('\n') 3 del old_data[0] 4 # 四舍五入得到新数据 5 new_data = [] 阅读全文
posted @ 2023-06-05 22:47 ‘_‘ 阅读(36) 评论(0) 推荐(0)
摘要: 实验任务1 task1 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 11 sum = inc(7) + inc(7) 12 print(sum) Vie 阅读全文
posted @ 2023-05-23 12:11 ‘_‘ 阅读(27) 评论(0) 推荐(0)
摘要: 实验任务1 1 import random 2 print('用列表存储随机整数: ') 3 lst = [random.randint(0, 100) for i in range(5)] 4 print(lst) 5 print('\n用集合存储随机整数: ') 6 s1 = {random.r 阅读全文
posted @ 2023-04-25 23:00 ‘_‘ 阅读(41) 评论(0) 推荐(0)
摘要: 实验任务1 task1 1 x = 'nba FIFA' 2 print(x.upper()) 3 print(x.lower()) 4 print(x.swapcase()) 5 print() 6 7 x = 'abc' 8 print(x.center(10, '*')) 9 print(x. 阅读全文
posted @ 2023-03-23 13:46 ‘_‘ 阅读(48) 评论(0) 推荐(0)
摘要: 实验任务1 task1-1 Python源码 1 print('hey,u') 2 print('hey', 'u') 3 x,y,z = 1,2,3 4 print(x,y,z) 1 x,y,z = 1,2,3 2 print('x = %d, y = %d, z = %d' %(x,y,z)) 阅读全文
posted @ 2023-03-09 13:41 ‘_‘ 阅读(35) 评论(0) 推荐(0)