1.for 循环
#coding = utf-8
count = 0
for i in range(8):
count += 1
i = i+ 2
print count
>>> 8
count的值为8说明循环了8次,循环的次数并不因为我们在循环中改变i的值改变,即在循环中改变i的值没有意义
2."" -------->表示空字符串
" " ---------->表示有一个空格元素的字符串
3.字符串的find方法
>>> "".find("a")
>>> -1
>>> "abc".find('')
>>> 0
空的字符串也可以调用find()方法
4.字符串的分片操作 VS 索引操作
>>>ss = "asdfg"
>>>aa = ss[1:8]
>>>aa
>>>"sdfg"
>>>ss[5:8]
""
>>>ss[8]
IndexError: string index out of range
5.list的append()用法
>>>res=[]
>>>res.append(5+3)
>>>res.append(5+3*2)
>>>res
[8,11]
append的参数可以是表达式