摘要: 任务1 class Account: def __init__(self, name, account_number, initial_amount = 10): self._name = name self._card_no = account_number self._balance = ini 阅读全文
posted @ 2023-06-13 11:08 吃花椒de猫 阅读(18) 评论(0) 推荐(0)
摘要: 任务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 main(): pensize 阅读全文
posted @ 2023-06-12 10:12 吃花椒de猫 阅读(20) 评论(0) 推荐(0)
摘要: 任务6: with open('data6.csv','r',encoding='gbk')as f: data=list(f.readlines()) data=[i.strip('\n') for i in data ] import decimal decimal.getcontext().r 阅读全文
posted @ 2023-06-07 09:37 吃花椒de猫 阅读(28) 评论(0) 推荐(0)
摘要: task1 print(sum) sum = 42 print(sum) def inc(n): sum = n+1 print(sum) return sum sum = inc(7) + inc(7) print(sum) 运行结果: task2.1 def func1(a, b, c, d, 阅读全文
posted @ 2023-05-23 21:15 吃花椒de猫 阅读(37) 评论(0) 推荐(0)
摘要: 任务一 import random print('用列表存储随机整数: ') lst = [random.randint(0, 100) for i in range(5)] print(lst) print('\n用集合存储随机整数: ') s1 = {random.randint(0, 100) 阅读全文
posted @ 2023-04-25 23:46 吃花椒de猫 阅读(33) 评论(0) 推荐(0)
摘要: 任务一: 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.r 阅读全文
posted @ 2023-03-28 12:59 吃花椒de猫 阅读(42) 评论(0) 推荐(0)
摘要: 试验任务1: task1_1 1 #task1_1 print输出的几种用法 2 #1 3 print('hey,u') 4 #2 5 print("hey","u") 6 x,y,z=(1,2,3) 7 print((x,y,z)) 8 #3 9 print(("x=%d,y=%d,z=%d"%( 阅读全文
posted @ 2023-03-09 10:46 吃花椒de猫 阅读(57) 评论(0) 推荐(0)