摘要: from turtle import* def square(size = 50,rgb='orange'): pencolor(rgb) for i in range(4): fd(size) left(90) def main(): setup(800,600) speed(0) for i i 阅读全文
posted @ 2021-06-11 16:48 rubus 阅读(22) 评论(1) 推荐(0)
摘要: class StudentDoc: def __init__(self,studentnumber,name,major,point): self._studentnumber = studentnumber self._name = name self._major = major self._p 阅读全文
posted @ 2021-05-25 16:42 rubus 阅读(44) 评论(1) 推荐(0)
摘要: with open('data1_1.txt', 'r', encoding= 'utf-8') as f: data = f.readlines() n = 0 for line in data: if line.strip('\n') == '': continue n += 1 print(f 阅读全文
posted @ 2021-05-11 17:19 rubus 阅读(52) 评论(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-16 17:28 rubus 阅读(41) 评论(1) 推荐(0)
摘要: x1, y1 = 1.2, 3.57 x2, y2 = 2.26, 8.7 print('{:-^40}'.format('输出1')) print('x1 = {}, y1 = {}'.format(x1, y1)) print('x2 = {}, y2 = {}'.format(x2, y2)) 阅读全文
posted @ 2021-04-02 17:33 rubus 阅读(35) 评论(1) 推荐(0)
摘要: 任务一 print('hey,u') print('hey','u') x = 1 y = 2 z = 3 print(x,y,z) print('x = %d,y = %d,z = %d' %(x,y,z)) print('x ={},y ={},z ={}'.format(x,y,z)) pri 阅读全文
posted @ 2021-04-01 15:46 rubus 阅读(48) 评论(1) 推荐(0)