Guest User

Untitled

a guest
Jun 4th, 2020
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.13 KB | None | 0 0
  1. def recite(start, take=1):
  2.     song = []
  3.     for take in range(0, take):
  4.         if start > 2:
  5.             song.extend([f"{start} bottles of beer on the wall, {start} bottles of beer.",
  6.                         f"Take one down and pass it around, {start-1} bottles of beer on the wall.",""])
  7.             start -= 1
  8.             #print(song)
  9.         elif start == 2:
  10.             song.extend([
  11.                 f"{start} bottles of beer on the wall, {start} bottles of beer.",
  12.                 f"Take one down and pass it around, {start-1} bottle of beer on the wall.",""])
  13.             start -= 1
  14.         elif start == 1:
  15.             song.extend([
  16.                 f"{start} bottle of beer on the wall, {start} bottle of beer.",
  17.                 "Take it down and pass it around, no more bottles of beer on the wall.",""])
  18.             start -= 1
  19.             #print(song)
  20.         elif start < 1:
  21.             song.extend([
  22.                 "No more bottles of beer on the wall, no more bottles of beer.",
  23.                 "Go to the store and buy some more, 99 bottles of beer on the wall."])
  24.             break
  25.     #print(song)
  26.     return song
Add Comment
Please, Sign In to add comment