摘要: task 1_1 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): move 阅读全文
posted @ 2021-06-16 22:42 玮光溢彩 阅读(74) 评论(1) 推荐(0)
摘要: task1 class Account: '''一个模拟银行账户的简单类''' def __init__(self, name, account_number, initial_amount): # 构造新账 户 self._name = name self._card_no = account_n 阅读全文
posted @ 2021-05-30 19:18 玮光溢彩 阅读(69) 评论(1) 推荐(0)
摘要: 任务6.with open('data6_1.txt','r',encoding='utf-8') as f: with open('data6-2.txt ','w',encoding='utf-8') as m: a = f.readlines() list1 = [] for line in 阅读全文
posted @ 2021-05-16 20:35 玮光溢彩 阅读(79) 评论(1) 推荐(0)
摘要: # 基础操作练习1: 格式控制、列表解析、类型转换 x = list(range(10)) print('整数输出1: ', end = '') for i in x: print(i, end=' ') print('\n整数输出2: ', end = '') for i in x: print( 阅读全文
posted @ 2021-04-22 22:17 玮光溢彩 阅读(93) 评论(1) 推荐(0)
摘要: x1, y1 = 1.2, 3.57 x2, y2 = 2.26, 8.7 # 输出1 print('{:-^40}'.format('输出1')) print('x1 = {}, y1 = {}'.format(x1, y1)) print('x2 = {}, y2 = {}'.format(x2 阅读全文
posted @ 2021-04-07 20:33 玮光溢彩 阅读(83) 评论(1) 推荐(0)
摘要: # print输出的几种用法 # 用法1:用于输出单个字符串或单个变量 print('hey, u') # 用法2: 用于输出多个数据项,用逗号分隔 print('hey', ' u') x = 1 y = 2 z = 3 print(x, y, z) # 用法3: 用户混合字符串和变量值 prin 阅读全文
posted @ 2021-04-02 18:45 玮光溢彩 阅读(73) 评论(0) 推荐(0)