-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscat.py
More file actions
47 lines (43 loc) · 1.07 KB
/
scat.py
File metadata and controls
47 lines (43 loc) · 1.07 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Jacobus Burger (2023)
# Info:
# Inspired by listening to some Cab Calloway, decided to make a program
# to convert a string to scat with decent flow. While working on it
# I realized that this is a decently complex problem.
def scat(string: str) -> str:
scats = {
'a': "aah",
'b': "bi",
'd': "dee",
'e': "ee",
'f': "fee",
'g': "gah",
'h': "hee",
'i': "idi",
'j': "jack",
'k': "kap",
'l': "lee",
'm': "mo",
'n': "nap",
'o': "oo",
'p': "pah",
'q': "quick",
'r': "rat",
's': "ski",
't': "tat",
'u': "udu",
'v': "vee",
'w': "wee",
'x': "zee",
'z': "zap"
}
result = []
for i in range(len(string)):
phrase = scats.get(string[i], None)
if phrase is not None:
result.append(phrase)
else:
result.append(string[i])
return ''.join(result)
if __name__ == '__main__':
string = input("gimmie a rhyme: ").lower()
print(scat(string))