循环
1.while循环
while condition:
if condition is true
run this
2.for循环
可迭代对象是指可以按次序迭代的对象(即用于for循环中的);
for number in numbers:
do something with number
run this
内建函数range提供的数字包含下限,但不包含上限;xrange函数与range函数类似,区别在于range函数一次性创建整个序列,而xrange函数一次只创建一个数;
3.循环遍历字典元素
for key, value in d.item():
do something with key and value
run this