摘要: from turtle import *def square(size=50): pencolor('orange') for i in range(4): fd(size) left(90)def main(): setup(800,600) speed(0) for i in range(10) 阅读全文
posted @ 2021-06-15 11:25 dsadsads 阅读(38) 评论(2) 推荐(0)
摘要: class StudentDoc: def __init__(self,student_number,name,major,score): self._student_number=student_number self._name=name self._major=major self._scor 阅读全文
posted @ 2021-05-30 20:48 dsadsads 阅读(60) 评论(1) 推荐(0)
摘要: with open('data6_1.txt', 'r', encoding = 'utf-8') as f: data = f.read().split('\n') content = [str(i).split('\t') for i in data] w = lambda content: c 阅读全文
posted @ 2021-05-18 10:32 dsadsads 阅读(61) 评论(1) 推荐(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 = '-') print('\n整 阅读全文
posted @ 2021-04-22 16:22 dsadsads 阅读(131) 评论(0) 推荐(0)
摘要: x1, y1 = 1.2, 3.57 x2, y2 = 2.26, 8.7 print('{:-^40}'.format('输出1')) # {:-^40}控制输出数据格式: 宽度占40列,居中对 齐,空白处用-补齐 print('x1 = {}, y1 = {}'.format(x1, y1)) 阅读全文
posted @ 2021-04-09 13:12 dsadsads 阅读(86) 评论(1) 推荐(0)
摘要: # print输出的几种用法 # 用法1:用于输出单个字符串或单个变量 print('hey, u') 用法2: 用于输出多个数据项,用逗号分隔 print('hey', ' u') x = 1 y = 2 z = 3 print(x, y, z) # 用法3: 用户混合字符串和变量值 print( 阅读全文
posted @ 2021-04-01 18:51 dsadsads 阅读(55) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-04-01 18:39 dsadsads 阅读(30) 评论(0) 推荐(0)