CMSC 201

Lab 5: Functions

Your job:

Write the missing functions for a Mad Libs program so that you can create a funny story!


Function #1: getInput(wordTypes) uses a loop to ask the user for different types of words (noun, verb, etc) and then returns the inputted words as a list


Function #2: printStory(wordList,storyList) prints out the story, using the list of words from getInput() to “fill the blanks)


Hints: use the list of word types to ask the user for the right kind of word.

tempWord = input("Enter a " + wordType[i] + ": ")