This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

Build a simple MadLib


Learn how to build a simple MadLib game using the "Roses are Red" poem.

1. Open Wing IDE and create a new file. If you don't know how, look around until you find the icon to click.

2. Type the following in the upper-left corner:

adjective1 = raw_input("Tell me an adjective, and click enter. ")
noun1 = raw_input("Tell me a noun (plural), and click enter. ")
noun2 = raw_input("Tell me another noun, and click enter. ")
adjective2 = raw_input("Tell me an another adjective, and click enter. ")

print "Roses are " + adjective1
print noun1 + " are blue"
print noun2 + " is " + adjective2
print "And so are you!"


3. Click the green "play" arrow and play your game in the lower-right corner.

4. If it didn't work, look carefully at the code above to see if your code has any errors. Find the errors and fix them.

5. Add a title to your poem and make it print out above the poem.

6. Add a space between your title and the rest of the poem.

7. Copy and paste your code into the discussion area below.

Task Discussion


  • Anonym said:

     adjective1 = raw_input("Tell me an adjective, and click enter. ")
    noun1 = raw_input("Tell me a noun (plural), and click enter. ")
    noun2 = raw_input("Tell me another noun, and click enter. ")
    adjective2 = raw_input("Tell me an another adjective, and click enter. ")
    
    print "Roses Are... What?!\n"
    print "Roses are " + adjective1
    print noun1 + " are blue"
    print noun2 + " is " + adjective2
    print "And so are you!"
    
    

    on Jan. 12, 2012, 3:16 p.m.
  • Sparker said:

     

    adjective1 = raw_input("Tell me an adjective, and click enter. ")
    noun1 = raw_input("Tell me a noun (plural), and click enter. ")
    noun2 = raw_input("Tell me another noun, and click enter. ")
    adjective2 = raw_input("Tell me another adjective, and click enter. ")
     
    print " "
    print "Flowers"
    print " "
    print "Roses are " + adjective1
    print noun1 + " are blue"
    print noun2 + " is " + adjective2
    print "And so are you!"
     
                           
    on Jan. 8, 2012, 5:50 p.m.
  • Landon said:

    # Define Informative Variables
    def info():
        print "\nThis program creates a custom version of the Roses are Red Poem\nusing four variables set by you (two adjectives and two nouns.)\n"
        print "An ADJECTIVE describes a noun."
        print "A NOUN is the name of a person, place, thing, or idea\n"
        
    # Define User Specific Variables
    def poem():
    adjective1= raw_input("Tell me an adjective, and click enter. ")
        noun1 = raw_input("Tell me a noun (plural), and click enter. ")
        noun2 = raw_input("Tell me another noun (singular), and click enter. ")
        adjective2 = raw_input("Tell me an another adjective, and click enter. ")
        title = raw_input("Enter A Poem Title: ")
        
        print ""
        print "Title: ",title
        print ""
        print "Roses are " + adjective1
        print noun1 + " are blue"
        print noun2 + " is " + adjective2
        print "And so are you!"
    info()
    poem()
    
    

    on Jan. 3, 2012, 3:56 a.m.
  • Jim Roma said:

    name = raw_input("Tell me your name and, click enter. ")
    adjective1 = raw_input(name + " tell me  an adjective, and click enter. ")
    noun1 = raw_input(name + " tell me a noun (plural), and click enter. ")
    noun2 = raw_input(name + " tell me another noun, and click enter. ")
    adjective2 = raw_input(name + " tell me an another adjective, and click enter. ")
    print ""
    print "A poem by " + name
    print "Roses are " + adjective1
    print noun1 + " are blue"
    print noun2 + " is " + adjective2
    print "And so are you!"

    on Dec. 28, 2011, 10:52 a.m.
  • Nathan Day said:

     

    1. adj1=raw_input("Type and adjective and press enter  ")
    2. adj2=raw_input("Type a second adjective and press enter  ")
    3. n1=raw_input("Type a noun (plural) and press enter  ")
    4. n2=raw_input("Type a second noun (singular) and press enter  ")
    5. title=raw_input("Type a title for your awesome new poem  ")
    6.  
    7. print ""
    8. print title
    9. print ""
    10. print "Roses are "+adj1
    11. print n1+" are blue"
    12. print n2+" is "+adj2
    13. print "and so are you!"
    on Dec. 26, 2011, 9:57 p.m.
  • Brylie Oxley said:

     

    # Gather the words
    adjective0 = raw_input("Tell me an adjective for the title: ")
    adjective1 = raw_input("Tell me an adjective: ")
    noun1 = raw_input("Tell me a plural noun: ")
    noun2 = raw_input("Tell me a noun: ")
    adjective2 = raw_input("And one more adjective: ")
    
    # Determine if 'a' or 'an' needs to be used in the title
    if adjective0[0].lower() in ['a','o','e','u', 'i']:
        print "An " + adjective0 + " poem."
    else:
        print "A " + adjective0 + " poem."
    
    # Print the poem
    print ""
    print "Roses are " + adjective1
    print noun1 + " are blue."
    print noun2 + " is " + adjective2
    print "and so are you!"

    on Dec. 23, 2011, 2:45 a.m.