Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- our_List = ["itemOne", "itemTwo", "Crusty Bread"]
- for i in range(len(our_List)): # iterate over list with range(len(our_List))
- current_i_value = i # isolate current value of i (it will incrememnt with each loop)
- associated_list_value = our_List[i] # isolate list value whose index matches current value of i
- print("%s: %s" %(current_i_value, associated_list_value)) # print isolated values back to back using string formatting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement