looping techniques when looping through dictionariesthe key and corresponding value can be retrieved at the same time using the items(method knights {'gallahad''the pure''robin''the brave'for kv in knights items()print(kvgallahad the pure robin the brave when looping through sequencethe position index and corresponding value can be retrieved at the same time using the enumerate(function for iv in enumerate(['tic''tac''toe'])print(iv tic tac toe to loop over two or more sequences at the same timethe entries can be paired with the zip(function questions ['name''quest''favorite color'answers ['lancelot''the holy grail''blue'for qa in zip(questionsanswers)print('what is your { }it is { format(qa)what is your nameit is lancelot what is your questit is the holy grail what is your favorite colorit is blue to loop over sequence in reversefirst specify the sequence in forward direction and then call the reversed(function for in reversed(range( ))print( to loop over sequence in sorted orderuse the sorted(function which returns new sorted list while leaving the source unaltered basket ['apple''orange''apple''pear''orange''banana'for in sorted(set(basket))print(fapple banana orange pear looping techniques