Python
文章平均质量分 54
Franker_W
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
从零开始学Python-第一天
我的第一个Python代码print('hellow word') 输出为hellow word从零开始学Python-第二天原创 2018-12-13 21:42:40 · 271 阅读 · 0 评论 -
从零开始学Python-第三天
关于list排序的一些函数StrList = ['f1', 'n4', 'f0', 'b3']print("StrList:"+str(StrList))print("sorted(list) 会返回对list排完序之后的序列")print("sorted(StrList):"+str(sorted(StrList)))print("可以看到原序列的顺序并没有改变")print...原创 2018-12-19 21:34:39 · 523 阅读 · 0 评论 -
从零开始学Python-第四天
与and 或or 非not 存在于in 不存在于not innum = range(3,31,3)print(num) print(10 in num) #Falseprint(10 not in num) #Trueprint...原创 2018-12-20 22:34:14 · 430 阅读 · 0 评论 -
从零开始学Python-第五天
标准库randomrandint(a,b)返回闭区间[a,b]之间的随机数die.pyfrom random import randintclass Die(): """筛子类""" def __init__(self, sides = 6): self.sides = sides def roll_die(self): '...原创 2018-12-21 23:59:32 · 217 阅读 · 0 评论 -
从零开始学Python-第六天
单元测试待测代码if1.pydef GetName(Ming, Xin = "王"): """获取名字""" name = Xin + " "+ Ming return name测试代码需要继承自TestCase; 测试代码可以有setUp()接口,在执行测试代码前会执行此接口; 测试函数已"test_"开头; 调用unittest.main(),原创 2018-12-23 20:19:28 · 204 阅读 · 0 评论 -
从零开始学Python-第二天
一个关于list操作以及while循环的实例eat = ['张三','李四','王五']for i in range(0,len(eat)): print("我要邀请"+eat[i]+'一起吃饭。')#[i]访问并操作元素print('刚刚得知'+ eat[1] + '无法前来赴约!')newName = '赵六'print('我将邀请' + newName + '替换'...原创 2018-12-18 21:29:15 · 306 阅读 · 0 评论
分享