摘要: from turtle import * from random import * def moveto(x, y): penup() goto(x, y) pendown() def square(x, y, z = [0, 0, 0]): seth(-90) color(z) begin_fil 阅读全文
posted @ 2021-06-17 20:27 #三三 阅读(61) 评论(0) 推荐(0)
摘要: 实验任务1 ''' 银行账户 数据:持卡人姓名、账号、当前余额 操作:提款、取款、打印账户信息 ''' class Account: '''一个模拟银行账户的简单类''' def __init__(self, name, account_number, initial_amount):#构造新账户 阅读全文
posted @ 2021-05-31 22:57 #三三 阅读(51) 评论(1) 推荐(0)
摘要: with open('data1_1.txt', 'r', encoding = 'utf-8') as f: n = 0 for line in f: if line.strip('\n') == '': continue n += 1 print(f'共{n}行') with open('dat 阅读全文
posted @ 2021-05-18 12:59 #三三 阅读(48) 评论(0) 推荐(0)
摘要: x = list(range(10)) print('整数输出1:', end = '') for i in x: print(i, end = ' ') print('\n整数输出2:', end = '') for i in x: print(f'{i:02d}',end = '-') prin 阅读全文
posted @ 2021-04-22 20:01 #三三 阅读(51) 评论(0) 推荐(0)
摘要: 实验一 x1, y1 = 1.2, 3.57x2, y2 = 2.26, 8.7 print('{:-^40}'.format('输出1'))print('x1 = {}, y1 = {}'.format(x1, y1))print('x2 = {}, y2 = {}'.format(x2, y2) 阅读全文
posted @ 2021-04-08 19:04 #三三 阅读(40) 评论(0) 推荐(0)
摘要: task1 print('hey, u') print('hey', ' u')x = 1y = 2z = 3print(x, y, z) print('x = %d, y = %d, z = %d' %(x, y, z))print('x = {}, y = {}, z = {}'.format( 阅读全文
posted @ 2021-04-02 19:08 #三三 阅读(88) 评论(0) 推荐(0)