摘要:
task1_1.py from turtle import * def moveto(x,y): penup() goto(x,y) pendown()def main(): setup(800,600) speed(0) for radius in range(20,200,20): moveto 阅读全文
摘要:
'''银行账户数据:持卡人姓名、账号、当前余额操作:提款、取款、打印账户信息'''class Account: '''一个模拟银行账户的简单类''' def __init__(self, name, account_number, initial_amount): # 构造新账户 self.name 阅读全文
摘要:
#统计文件data1_1.txt的行数(不包括空白行)#data1_1中的空白行都是由\n组成的空白行#task1_1.pywith open('data1_1.txt','r',encoding='utf-8') as f: data=f.readlines()n=0for line in dat 阅读全文
摘要:
#基础操作练习一:格式控制 列表解析 类型转换x=list(range(10))print('整数输出一:',end='')for i in x: print(i,end='')print('整数输出二:',end='')for i in x: print(f'{i:02d}',end='-')pr 阅读全文
摘要:
x1, y1 = 1.2, 3.57x2, y2 = 2.26, 8.7print('{:-^40}'.format('输出1'))print('x1 = {}, y1 = {}'.format(x1, y1))print('x2 = {}, y2 = {}'.format(x2, y2))prin 阅读全文