-
Notifications
You must be signed in to change notification settings - Fork 0
/
BOJ_17293.py
30 lines (28 loc) · 1.13 KB
/
BOJ_17293.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
n = int(input())
for i in range(n, -1, -1):
if i >= 2:
w1 = str(i) + ' bottles'
w2 = str(i-1) + ' bottles' if i-1 > 1 else '1 bottle'
elif i == 1:
w1 = '1 bottle'
w2 = 'no more bottles'
else:
w1 = 'no more bottles'
w2 = str(n) + ' bottles' if n > 1 else '1 bottle'
print(w1 + ' of beer on the wall, ' + w1 + ' of beer.' if w1 != 'no more bottles' else
'No more bottles of beer on the wall, no more bottles of beer.')
print('Take one down and pass it around, ' + w2 + ' of beer on the wall.' if w1 != 'no more bottles' else
'Go to the store and buy some more, ' + w2 + ' of beer on the wall.')
print('')
# def n(x):
# if x == 0:
# return 'no more bottles'
# return '1 bottle' if x == 1 else str(x)+' bottles'
#
# j = int(input())
# for i in range(j, 0, -1):
# print(n(i) + ' of beer on the wall, ' + n(i) + ' of beer.')
# print('Take one down and pass it around, ' + n(i-1) + ' of beer on the wall.')
# print('')
# print("No more bottles of beer on the wall, no more bottles of beer.")
# print("Go to the store and buy some more, " + n(j) + " on the wall.")