Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. def get_pins(observed):
  2.     from itertools import permutations
  3.     nums = {
  4.     "1" : "124",
  5.     "2" : "2135",
  6.     "3" : "326",
  7.     "4" : "4157",
  8.     "5" : "52468",
  9.     "6" : "6359" ,
  10.     "7" : "748",
  11.     "8" : "85790",
  12.     "9" : "968",
  13.     "0" : "8"
  14.     }
  15.     new_list = ""
  16.     for i in observed:
  17.         new_list += (nums.get(i))
  18.     permut_list = []
  19.     new_list = list(permutations(new_list,len(observed)))
  20.     final_list = []
  21.     for i in new_list:
  22.         final_list.append(''.join(i))
  23.     final_list = set(final_list)
  24.     final_list2 = []
  25.     for i in final_list:
  26.         final_list2.append(i)
  27.     return final_list2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement