![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
403_ss
hi,l am dying
展开
-
Python 常见错误记载
IndentationError:expectedanindentedblock 最常见的情况是tab和空格的混用会导致错误,或者缩进不对。 標題錯誤说明此处需要缩进,你只要在出现错误的那一行,按空格或Tab(但不能混用)键缩进就行。 (有冒号的下一行往往要缩进,该缩进就缩进) IndentationError:unexpectedindent 没必要的缩进 ,应该删...转载 2019-03-12 16:40:36 · 867 阅读 · 0 评论 -
Python冲上云霄之路(寥雪峰网站篇学习)
切片(Slice)操作符,指定索引范围的操作 L = [ ' a ' ,' b ' , ' c ' , ' d '] print( L[0:3] ) L[0:3]表示,从索引0开始取,直到索引3为止,但不包括索引3,因此是 a , b , c ,这三个数 如果第一个索引是0,还可以省略 print( L[:3] ) Python支持L[-1]取倒数第一个元素,那么它同样支持倒数切片,...转载 2019-03-12 22:19:57 · 143 阅读 · 0 评论