31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
# %%
|
||
# File: Pease-hw3c.py
|
||
# Author: PEASE, NICHOLAS
|
||
# Date: 12 OCT 2022
|
||
# Section: 1002-LAB
|
||
# E-mail: nicholas.pease@maine.edu
|
||
# Description:
|
||
# Write a program to generate silly song lyrics about favorite Maine foods.
|
||
# Your program should get the food and number of verses from the user and call a
|
||
# function named singVerse() the requested times to generate the verses.
|
||
# Here is some sample output, with the user input in bold. (Yours does not have to
|
||
# match this exactly, but it should be similar. You may assume that all foods come in
|
||
# bottles. Don’t worry about the details of grammar related to singular/plural.
|
||
# Collaboration:
|
||
# I collaborated with no one
|
||
|
||
# %%
|
||
def main():
|
||
food = input("What is your favorite Maine food? ")
|
||
verses = int(input("How many verses? "))
|
||
for i in range(verses, 0, -1):
|
||
singVerse(food,i)
|
||
print("Oh, no. The "+food+" is all gone!")
|
||
main()
|
||
|
||
# %%
|
||
def singVerse(food, number):
|
||
print(str(number)+" bottles of "+food+" on the wall, "+str(number)+" bottles of "+food+", Take one down, pass it around, "+str(number-1)+" bottles of "+food+" on the wall. ")
|
||
|
||
|