摘要: class Base(): def play(self): print('--base--')class A(Base): def play(self): # super().play() print('--A--')class B(Base): def play(self): super().pl 阅读全文
posted @ 2018-11-28 02:55 特洛斯兰 阅读(102) 评论(0) 推荐(0) 编辑
摘要: https://docs.python.org/3.6/library/index.html 阅读全文
posted @ 2018-11-25 22:54 特洛斯兰 阅读(242) 评论(0) 推荐(0) 编辑
摘要: a=1 b=1 while a<10 and b<10: print ('%d*%d=%2d'%(a,b,a*b),end=' ') b=b+1 if b==10: print('') a=a+1 b=1 阅读全文
posted @ 2018-11-21 03:14 特洛斯兰 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 赋值:b=cb,c共用一个id,对其中一个进行操作对另一个有相同的作用浅复制:d=b.copy()将b现有的内容复制放进另一个id,对b[ ]进行操作对c没有影响,但是对b里面的变量进行操作时会对c有相同的作用深复制:import copy e=copy.deepcopy(b)对b现有的值进行复制, 阅读全文
posted @ 2018-11-17 01:46 特洛斯兰 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 编写代码的时候要注意 在给变量或者对象赋值的时候要注意有些代码是不返回值的 比如: a.sort(),a.reserve(),a.ppend()等等 阅读全文
posted @ 2018-11-16 18:55 特洛斯兰 阅读(149) 评论(0) 推荐(0) 编辑
摘要: +-*/% 取余** 次方// 取整 变量:使用前必须得赋值(就是得用等于)变量命名规则:1.不能是数字开头 2.特殊字符只有_可以使用 python的数值类型:1.int 2.float(注意浮点数不精确,需要用decimal来解决)3.bool(1.注意首字母大写,2.只有两个值True、Fal 阅读全文
posted @ 2018-11-15 00:22 特洛斯兰 阅读(121) 评论(0) 推荐(0) 编辑