Files
2022-10-12 20:18:32 -04:00

31 lines
1.1 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# %%
# 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. Dont 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. ")