![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
计算机语言
benbenls
这个作者很懒,什么都没留下…
展开
-
Python if 和 for 的多种写法
a, b, c = 1, 2, 3 【对比Cpp里:c = a >b? a:b】这个写法,python只能常规的空行,缩进吗? 人生苦短,我用python,下面介绍几种if的方便的方法。 1.常规 if a>b: c = a else: ...转载 2019-12-06 14:31:03 · 466 阅读 · 0 评论 -
Python中双冒号的作用[::]
Python中双冒号的作用[::] Python sequence slice addresses can be written as a[start:end:step] and any of start, stop or end can be dropped. Python序列切片地址可以写为[开始:结束:步长],其中的开始和结束可以省略 range(n)生成[0,n)区间整数 rang...转载 2019-12-06 14:28:10 · 400 阅读 · 0 评论