Anonymous user
99 bottles of beer: Difference between revisions
m
→Python 3, a readable version
Line 6,956:
=={{header|Python}}==
===Python 3, a readable version===
Most people solving this task iterate from 99 to 0. But 2, 1 and 0 are special cases, therefore they write conditional expressions to split flow control. Anyway the "if" instruction is unnecessary at all. The special
<lang Python>
"""Pythonic 99 beer song (readability counts)."""
{n} bottles of beer on the wall, {n} bottles of beer
Take one down and pass it around, {n_minus_1} bottles of beer on the wall.
Line 6,984:
for n in range(99, 2, -1):
print(
print(ending_verses)</lang>
|