摘要: import turtle turtle.setup(800,600) turtle.pencolor('pink') for i in range(4): for i in range(2): turtle.circle(80,90) turtle.left(90) turtle.right(90 阅读全文
posted @ 2021-06-11 17:18 申富明 阅读(160) 评论(2) 推荐(0)
摘要: class StudentDoc: def __init__(self,number,name,major,score): self.number = number self.name = name self.major = major self.score = score def info(sel 阅读全文
posted @ 2021-05-25 16:46 申富明 阅读(128) 评论(2) 推荐(0)
摘要: with open('data6_1.txt','r',encoding = 'utf-8') as f: l = [] z = f.readlines() for i in z: p = [] i.strip() p.append(i[0:5].strip()) p.append(i[5:8].s 阅读全文
posted @ 2021-05-12 20:50 申富明 阅读(138) 评论(3) 推荐(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(f'{i 阅读全文
posted @ 2021-04-16 21:43 申富明 阅读(183) 评论(2) 推荐(0)
摘要: # 使用字符串的format()方法,对输出数据项进行格式化 x1, y1 =1.2, 3.57 x2, y2 =2.26, 8.7 # 输出1 print('{:-^40}'.format(x1, y1)) # {:-^40}控制输出数据格式:宽度占40列,居中对齐,空白处用-补齐 print(' 阅读全文
posted @ 2021-04-02 21:07 申富明 阅读(201) 评论(3) 推荐(0)
摘要: #task1: # print输出的几种用法 # 用法1:用于输出单个字符串或单个变量 print('hey,''u') # 用法2:用于输出多个数据项,用逗号分隔 print('hey,''u') x = 1 y = 2 z = 3 print(x,y,z) # 用法3:用户混合字符串和变量值 p 阅读全文
posted @ 2021-03-30 21:18 申富明 阅读(180) 评论(3) 推荐(1)