-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRotaryDial.py
More file actions
29 lines (23 loc) · 845 Bytes
/
RotaryDial.py
File metadata and controls
29 lines (23 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class RotaryDial:
keypadMatrix = [
["a", "b", "c", "2"],
["d", "e", "f", "3"],
["g", "h", "i", "4"],
["j", "k", "l", "5"],
["m", "n", "o", "6"],
["p", "q", "r", "s", "7"],
["t", "u", "v", "8"],
["w", "x", "y", "z", "9"],
["DELETE"]
]
readlineString = ""
def rotaryNumberToList(self, readlineString, searchList):
newList = []
if len(searchList) > 0:
for searchString in searchList:
for character in RotaryDial.keypadMatrix[ int(readlineString)-2 ]:
newList.append( searchString + character )
else:
for character in RotaryDial.keypadMatrix[ int(readlineString)-2 ]:
newList.append( character )
return newList