Advertisement
Blessing988

Untitled

Feb 21st, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. def same_index_values(list1, list2):
  2.     index_list= [ ]
  3.     for element in list1 and list2:
  4.         if list1.index(element)==list2.index(element):
  5.             index_list.append(list1.index(element))
  6.     print(index_list)
  7.  
  8. same_index_values(["a", "b", "c", "d"], ["c", "b", "a", "d"]) #Example (It must contain two arguments and the arguments must be lists)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement