# File: madLibs.py # Author: Jeremy Dixon # Date: 9/03/15 # Section: 7/13 # E-mail: jdixon@cs.umbc.edu # Updated: 9/11/2016, Katherine Gibson # Description: # This file contains python code that practices mad libs # and storing information in variables. # There are 24 (updated to 16) inputs for this mad lib # Thanks to http://www.madglibs.com/printglib.php?glibid=3 # get input from the user for the 'blanks' str1 = input("Enter a time span: ") str2 = input("Enter a noun: ") str3 = input("Enter a verb: ") str4 = input("Enter a verb: ") str5 = input("Enter a noun (plural or singular): ") str6 = input("Enter a noun: ") str7 = input("Enter a verb (ending in -ing): ") str10 = input("Enter a noun: ") str11 = input("Enter a famous person: ") str12 = input("Enter an adjective: ") str13 = input("Enter a verb: ") str14 = input("Enter a noun: ") str17 = input("Enter a noun (plural): ") str18 = input("Enter a verb: ") str19 = input("Enter a preposition: ") str20 = input("Enter a verb: ") # capitalize the first letter of str10 and str11 str10 = str10[0].upper() + str10[1:] str11 = str11[0].upper() + str11[1:] # print out the mad lib print() print("Every", str1 + ", I wake up and get off my" , str2 + ". I don't") print("always have time to", str3, "a shower, but I always make") print("sure to", str4, "my hair. Once that's done I get some") print(str5 + ", and then it is off to my first", str6 + ". I often") print("get caught", str7, "in class. My second class is") print(str10, "Theory. Dr.", str11, "is incredibly", str12 + ",") print("but I never", str13, "around them because of their thick") print(str14 + ". After lunch, I have no more", str17, "and") print("I'm free to", str18, str19, "my friends. Before I") print("go to bed I", str20, "a little bit.") print()