Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions 4-loops/20_99_bottles_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 99 Bottles of Beer 🍻
# Codédex

for i in range(99, 0, -1):
if i > 1:
print(f'{i} bottles of beer on the wall')
print(f'{i} bottles of beer')
print(f'Take one down, pass it around')
print(f'{i-1} bottles of beer on the wall\n')
else:
print(f'{i} bottle of beer on the wall')
print(f'{i} bottle of beer')
print(f'Take one down, pass it around')
print(f'No more bottles of beer on the wall\n')
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ Welcome to The Legend of Python GitHub repo! We are super excited to have you. H
- [`enter_pin.py`](https://github.com/codedex-io/python-101/blob/main/4-loops/17_enter_pin.py)
- [`guess_number.py`](https://github.com/codedex-io/python-101/blob/main/4-loops/18_guess_number.py)
- [`detention.py`](https://github.com/codedex-io/python-101/blob/main/4-loops/19_detention.py)
- [`99_bottles.py`](https://github.com/codedex-io/python-101/blob/main/4-loops/20_99_bottles.py)
- [`99_bottles.py`](https://github.com/codedex-io/python-101/blob/main/4-loops/20_99_bottles.py) (solution 1)
- [`99_bottles.py`](https://github.com/codedex-io/python-101/blob/main/4-loops/20_99_bottles_2.py) (solution 2)
- [`fizz_buzz.py`](https://github.com/codedex-io/python-101/blob/main/4-loops/21_fizz_buzz.py)

## <img src="https://raw.githubusercontent.com/codedex-io/python-101/main/assets/badge_lists.png" height="20" style="vertical-align: middle;"> Lists
Expand Down