摘要: task1 class Account: def __init__(self,name,account_number,initial_amount=10): self._name=name self._card_no=account_number self._balance=initial_amou 阅读全文
posted @ 2023-06-07 11:09 AurTw1 阅读(25) 评论(0) 推荐(0)
摘要: 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 main(): pens 阅读全文
posted @ 2023-06-05 09:47 AurTw1 阅读(37) 评论(0) 推荐(0)
摘要: task6 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(). 阅读全文
posted @ 2023-06-02 00:21 AurTw1 阅读(73) 评论(3) 推荐(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) 1.打印sum函数 2.打印变量名为“sum”的变量 3.局部变量 4.全局变量 tas 阅读全文
posted @ 2023-05-18 16:59 AurTw1 阅读(38) 评论(0) 推荐(0)
摘要: test1 import random print('用列表储存随机整数:') lst=[random.randint(0,100)for i in range(5)] print(lst) print('\n用集合存储随机整数:') s1={random.randint(0,100)for i i 阅读全文
posted @ 2023-04-20 11:30 AurTw1 阅读(49) 评论(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,'*')) print(x.rjust( 阅读全文
posted @ 2023-03-22 23:26 AurTw1 阅读(34) 评论(0) 推荐(0)
摘要: task1_1: 1. print('hey,u') print('hey','u') x,y,z=1,2,3 print(x,y,z) print('x=%d,y=%d,z=%d' %(x,y,z)) print('x={},y={},z={}'.format(x,y,z)) print(f'x= 阅读全文
posted @ 2023-03-09 12:22 AurTw1 阅读(66) 评论(0) 推荐(0)