![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 80
凌云1992
这个作者很懒,什么都没留下…
展开
-
Python教程
1.Python基础Python的语法比较简单,采用缩进方式,写出来的代码就像下面的样子:# print absolute value of an integer:a = 100if a >= 0: print(a)else: print(-a)当语句以冒号:结尾时,缩进的语句视为代码块。python问题:IndentationError:expe原创 2017-04-16 19:23:22 · 548 阅读 · 0 评论 -
python2
1.Python range()函数如果你需要一个数值序列,使用内建函数range() 会很方便,它产生等差级数序列。for i in range(5): print(i)2.经常取指定索引范围的操作,Python提供了切片(Slice)操作符>>> L=['A','B','C']>>> L[0:2]['A', 'B']>>> L[0:3]['A',原创 2017-04-21 07:58:51 · 472 阅读 · 0 评论