SHARE
TWEET

Untitled

a guest Feb 21st, 2020 124 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def same_index_values(a,b):
  2.     new_list =[]
  3.     i=0
  4.     while i < len(a):
  5.         if a[i]==b[i]:
  6.            
  7.             x =a.index(a[i])
  8.            
  9.             new_list.append(x)
  10.            
  11.         i+=1
  12.        
  13.     return new_list
  14.            
  15. print(same_index_values([1,2,3],[3,2,1]))
  16. print(same_index_values(['a','b','c','d'],['c','b','a','d']))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top