99 bottles of beer: Difference between revisions

Content deleted Content added
→‎One line: 1. bottle without s is optional (but you can add it easily); 2: the task does not mention the "canonical" text (anyway, you can add it easily); 3: the task does not says anything about PEP8
m →‎One line: regression
Line 10,183: Line 10,183:
Short, one-line version.
Short, one-line version.


<syntaxhighlight lang="python">for i in range(99, 0, -1): b='bottles of beer'; w = b + ' on the wall'; print(f'{i} {b} on the wall, {i} {b}\nTake one down and pass it around, {i - 1} {w}.\n')
<syntaxhighlight lang="python">for i in range(99, 0, -1):b='bottles of beer';w=f' {b} on the wall';print(f'{i}{w}, {i} {b}\nTake one down and pass it around, {i-1}{w}.\n')
</syntaxhighlight>
</syntaxhighlight>