摘要: from turtle import* def square(size=50,rgb='orange'): '''绘制rgb正方形 参数size指定边长 参数指定画笔颜色 如果没有给参数,采用默认值 ''' pencolor(rgb) for i in range(4): fd(size) left 阅读全文
posted @ 2022-06-13 21:52 赵跃箐 阅读(13) 评论(1) 推荐(0) 编辑
摘要: class User(): def __init__(self,name="guest",password='111111',status=1): self._name=name self._password=password self._status=status def define(self) 阅读全文
posted @ 2022-06-07 21:53 赵跃箐 阅读(20) 评论(1) 推荐(0) 编辑
摘要: def is_valid(m): if len(m)==18 and m.isdigit(): return 'True' elif len(m)==18 and m[-1]=='X': return 'True' else: return 'False' with open('D:/实验六数据文件 阅读全文
posted @ 2022-05-24 22:26 赵跃箐 阅读(13) 评论(1) 推荐(0) 编辑
摘要: with open('D:/实验五数据/data3.txt','r+', encoding='UTF-8') as f: Z=[] Y=[] x=[] for i in f: x.append(i.strip('\n')) newx=x[1:11] for i in newx: y=float(i) 阅读全文
posted @ 2022-05-16 22:50 赵跃箐 阅读(19) 评论(2) 推荐(0) 编辑
摘要: print(sum) def solve(a, b, c): ''' 求解一元二次方程, 返回方程的两个根 :para: a,b,c: int 方程系数 :return: tuple ''' delta = b*b - 4*a*c delta_sqrt = abs(delta)**0. p1 = - 阅读全文
posted @ 2022-05-09 21:34 赵跃箐 阅读(48) 评论(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 = '-') pri 阅读全文
posted @ 2022-04-13 14:47 赵跃箐 阅读(32) 评论(2) 推荐(0) 编辑
摘要: 1 print('hey, u') 2 print('hey', ' u') 3 x,y,z = 1,2,3 4 print(x, y, z) 5 print('x = %d, y = %d, z = %d' %(x,y,z)) 6 print('x = {}, y = {}, z = {}'.fo 阅读全文
posted @ 2022-03-28 22:33 赵跃箐 阅读(46) 评论(3) 推荐(0) 编辑