标签:
indexing ‘abc‘[0] == ‘a‘ ‘abc‘[-1] == ‘c‘
Slicing ‘abc‘[1:3] == ‘bc‘ [i:j:k] 最后一个参数 step 为负时,表示截取结果按照逆序排列
4. in
The operators in
and not in
test for collection membership (a ‘collection‘ refers to a string, list, tuple or dictionary - don‘t worry, we will cover lists, tuples and dictionaries soon!). The expression
Note this returns the negation of element in coll
- that is, the expression element not in coll
is equivalent to the expression not (element in coll)
.
5.
6.
标签:
原文地址:http://www.cnblogs.com/fusama/p/4586741.html