Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import itertools
- pin = raw_input()
- def get_pins(x):
- D = {
- 1:['1','2','4'],
- 2:['1','2','3','5'],
- 3:['2','3','6'],
- 4:['1','4','5','7'],
- 5:['2','4','5','6','8'],
- 6:['3','5','6','9'],
- 7:['4','7','8'],
- 8:['5','7','8','9','0'],
- 9:['6','8','9'],
- 0:['8','0']
- }
- L = []
- total = []
- for i in x:
- L.append(D[int(i)])
- for y in L:
- for i in itertools.permutations(y,len(x)):
- total.append(''.join(i))
- print L
- return sorted(total)
- print get_pins(pin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement