#Joseph Murray CSC 110 HW 1 #Madlibs: Take a story and replace some words with user input #My next door neighbor has a animal-dog named Mo. Mo has color-black fur and a #bushy bodypart-tail, and loves it when I scratch his bodypart-butt. His back arches #and he lets out a deep sound-growl. One day while on a walk, Mo jumps into my lap #and barfs his food-meatloaf from lunch all over me! All over my new color-blue #articleOfClothing-jeans! "exlamationWHYYYYYYYYY" I yell! Mo just looks up and burps adverb-happily. #introduction print("Hello, and welcome to a game of Mad Libs!") #input animal = input("Give me an animal: ") color1 = input("Give me a color: ") bodypart1 = input("Give me a part of the body: ") bodypart2 = input('Give me another part of the body: ') sound = input("Give me a sound, like 'growl', or 'BANG': ") food = input("Give me a food: ") color2 = input("Give me another color: ") clothing = input("Give me an article of clothing: ") exclamation = input("Give me an exlamation, like 'YES!': ") adverb = input("Give me an adverb: ") #output print("My next door neighbor has a "+ animal + " named Mo.") print(\) print("Mo has " + color1 + " fur and a bushy " + bodypart1 + ", and loves it when I scratch his " + bodypart2 + ". ") print(\) print("His back arches and he lets out a deep " + sound + ".") print("One day while on a walk, Mo jumps into my lap and barfs all of his" + \ + food + " from lunch all over me! All over my new " + color2 + clothing + "!") print('"', exclamation, '"', "I yell! Mo just looks up and burps " + adverb + ". ")
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question