Loop >>> knights={'gallahad':'the pure','robin':'the brave'} >>> for k,v in knights.item(): print(k,v) Traceback (most recent call last): File "<pyshell#20>", line 1, in <module> for k,v in knights.item(): AttributeError: 'dict' object has no attribute 'item' >>> for k,v in knights.items(): print(k,v) gallahad the pure robin the brave >>> for k,v in knights.items(): print(k,':',v) gallahad : the pure robin : the brave >>> for i,v in enumerate(['tic','tac','toe']): print(i,v) 0 tic 1 tac 2 toe >>> questions=['name','quest','favorate color'] >>> answers=['lann','the holy grail','blue'] >>> for q,a in zip(questions,answers): print('What is your {0}? It is {1}'.format(q,a)) What is your name? It is lann What is your quest? It is the holy grail What is your favorate color? It is blue >>> for i in reversed(range(1,10,2)): print(i) 9 7 5 3 1 >>> basket=['apple','orange','apple','pear','orange','bvannan'] >>> for f in sorted(set(baket)): print(f) Traceback (most recent call last): File "<pyshell#39>", line 1, in <module> for f in sorted(set(baket)): NameError: name 'baket' is not defined >>> basket=['apple','orange','apple','pear','orange','bvannan'] >>> for f in sorted(set(basket)): print(f) SyntaxError: unexpected indent (<pyshell#40>, line 1) >>> for f in sorted(set(basket)): print(f) apple bvannan orange pear >>>