-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBottle Song.py
49 lines (49 loc) · 1.63 KB
/
Bottle Song.py
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
48
49
def recite(start, take=1):
number_upper = {
10: "Ten",
9: "Nine",
8: "Eight",
7: "Seven",
6: "Six",
5: "Five",
4: "Four",
3: "Three",
2: "Two",
1: "One"
}
number_lower = {
10: "ten",
9: "nine",
8: "eight",
7: "seven",
6: "six",
5: "five",
4: "four",
3: "three",
2: "two",
1: "one",
0: "no"
}
res_lst = []
for _ in range(take):
if start == 2:
res_lst += [f"{number_upper[start]} green bottles hanging on the wall,",
f"{number_upper[start]} green bottles hanging on the wall,",
"And if one green bottle should accidentally fall,",
f"There'll be {number_lower[start - 1]} green bottle hanging on the wall.",""]
start -= 1
continue
if start == 1:
res_lst += [f"{number_upper[start]} green bottle hanging on the wall,",
f"{number_upper[start]} green bottle hanging on the wall,",
"And if one green bottle should accidentally fall,",
f"There'll be {number_lower[start - 1]} green bottles hanging on the wall.",""]
start -= 1
continue
res_lst += [f"{number_upper[start]} green bottles hanging on the wall,",
f"{number_upper[start]} green bottles hanging on the wall,",
"And if one green bottle should accidentally fall,",
f"There'll be {number_lower[start - 1]} green bottles hanging on the wall.",""]
start -= 1
res_lst.pop()
return res_lst