自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(5)
  • 收藏
  • 关注

原创 for循环中关于列表list中remove()不彻底的问题

关于remove() 删除不彻底的问题:a = [‘0’, ‘1’, ‘2’, ‘3’, ‘0’, ‘0’, ‘3’, ‘0’]for i in a:a=['1','A', '2', '3', 'A','A', '3','A', '5']for i in a: if i == 'A': a.remove(i)print(a)#['1', '2', '3', '3', 'A', '...

2020-02-21 23:04:57 678 2

原创 python 银行平均等待时间

python 银行平均等待时间class ATM(): def __init__(self, maxtime = 5): self.t_max = maxtime def getServCompleteTime(self, start = 0): return start + random.randint(1, self.t_max) cla...

2020-02-21 01:45:42 431

原创 Python3 内置异常类型的结构

Python3 内置异常类型的结构BaseException±- SystemExit±- KeyboardInterrupt±- GeneratorExit±- Exception±- StopIteration±- StopAsyncIteration±- ArithmeticError| ±- FloatingPointError| ±- OverflowEr...

2020-02-19 22:27:37 109

原创 python参数

参数1.必须参数:实际参数、形式参数2.关键字参数区别:函数调用,关键字参数增强代码可读性3.默认参数 default argument作用: 简化函数调用#1 必须参数def add(x,y): #x、y是形式参数,形参 result = x+y return result #在打印中,return value;若无return,则None a = add(1,2...

2020-02-16 21:54:11 86

原创 循环

一、 列表、元组、遍历#1a = ['apple','orange','mango','banana',(1,2,3)]print(a)#输出: ['apple', 'orange', 'mango', 'banana', (1, 2, 3)]#2a = [['apple','orange','mango','banana'],(1,2,3)]for i in a: print i...

2020-02-16 00:29:01 83

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除