摘要: 实验任务1 task1.py 1 class Account: 2 3 def __init__(self, name, account_number, initial_amount = 10): 4 self._name = name 5 self._card_no = account_numbe 阅读全文
posted @ 2023-06-14 00:11 !!!z 阅读(45) 评论(0) 推荐(0)
摘要: 实验任务1 task1_1.py 1 from turtle import * 2 def move(x, y): 3 '''画笔移动到坐标(x,y)处''' 4 penup() 5 goto(x, y) 6 pendown() 7 8 def draw(n, size = 100): 9 '''绘 阅读全文
posted @ 2023-06-12 14:19 !!!z 阅读(114) 评论(0) 推荐(0)
摘要: 实验任务6 task6.py 1 with open('data6.csv', 'r', encoding='gbk') as f: 2 old_data = f.read().split('\n') 3 del old_data[0] 4 processed_data = [] 5 for i i 阅读全文
posted @ 2023-06-06 23:49 !!!z 阅读(159) 评论(0) 推荐(0)
摘要: 实验任务1 task1.py 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) sum 阅读全文
posted @ 2023-05-21 21:39 !!!z 阅读(48) 评论(0) 推荐(0)
摘要: 实验任务1 task1.py 1 import random 2 print('用列表存储随机整数: ') 3 lst = [random.randint(0, 100) for i in range(5)] 4 print(lst) 5 print('\n用集合存储随机整数: ') 6 s1 = 阅读全文
posted @ 2023-04-26 03:33 !!!z 阅读(58) 评论(0) 推荐(0)
摘要: 实验任务1 task1.py 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 阅读全文
posted @ 2023-03-28 23:15 !!!z 阅读(36) 评论(0) 推荐(0)
摘要: 实验任务1 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={},z={}'.for 阅读全文
posted @ 2023-03-15 00:59 !!!z 阅读(100) 评论(0) 推荐(1)