摘要: 实验任务1: 实验源码: class Account: #一个模拟账户类 def __init__(self,name,account_number,initial_amount = 10): '''构造新账户''' self._name = name self._card_no = account 阅读全文
posted @ 2023-06-07 21:14 juice-up 阅读(35) 评论(0) 推荐(0)
摘要: 实验任务1: 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) de 阅读全文
posted @ 2023-06-06 17:11 juice-up 阅读(29) 评论(0) 推荐(0)
摘要: 实验任务6: 实验源码: with open('data6.csv','r',encoding='gbk') as f: data = f.readlines() data1=[str(eval(data[i])) for i in range(1,len(data))] data2=[str(in 阅读全文
posted @ 2023-06-05 16:11 juice-up 阅读(22) 评论(0) 推荐(0)
摘要: 实验任务1: 实验源码: print(sum) sum = 42 print(sum) def inc(n): sum = n+1 print(sum) return sum sum = inc(7) + inc(7) print(sum) 实验运行截图: 答: line1:内置函数line3:变量 阅读全文
posted @ 2023-05-19 16:32 juice-up 阅读(43) 评论(0) 推荐(0)
摘要: 实验任务1 task1: 实验源码 import random print('用列表存储随机整数:') lst=[random.randint(0,100) for i in range(5)] print(lst) print('\n用集合存储随机整数:') s1={random.randint( 阅读全文
posted @ 2023-04-21 16:27 juice-up 阅读(38) 评论(0) 推荐(0)
摘要: 实验任务1: x='nba FIFA' print(x.upper()) print(x.lower()) print(x.swapcase()) print() x='abc' print(x.center(10,'*')) print(x.ljust(10,'*')) print(x.rjust 阅读全文
posted @ 2023-03-23 14:08 juice-up 阅读(38) 评论(0) 推荐(0)
摘要: 实验任务一: task1_1: 实验源码: Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] on win32 Type "help", "copyright", "credi 阅读全文
posted @ 2023-03-12 15:12 juice-up 阅读(144) 评论(0) 推荐(0)