Metaphor Maker

"All the world's a stage, and all the men and women in it merely players." -William Shakespeare

"Dying is a wild night and a new road." -Emily Dickinson

"But soft! What light through yonder window breaks? It is the East, and Juliet is the sun!" -William Shakespeare

All of the examples above are metaphors. A metaphor is a type of figurative language used for dramatic empahsis. There are different ways to structure a metaphor, but perhaps the simplest way is by using a conjugation of "to be" (am/are/is): "All the [world is] a stage...", "Dying is a wild night...", "Juliet is the sun!". When we use this metaphor structure, we generally follow this formula:

metaphor = first noun phrase + "to be" conjugation + second noun phrase

We're going to use this formula to create a Metaphor Maker program using the metaphors above.

  1. Step 1

    Our metaphor formula is

    metaphor = first noun phrase + “to be” conjugation + second noun phrase

    A noun phrase contains a noun and any descriptive words that accompany it, like articles, adjectives, and other parts of speech.

    Let’s figure out what our noun phrases are. Take a look at our metaphors again:

    All the world [is] a stage...
    Juliet is the sun!
    Dying is a wild night...

    We also need to identify the “to be” conjugation in each metaphor. In all of the metaphors we’re using, the “to be” conjugation is “is”.

    Next we’ll learn about variables and values!

  2. Step 2

    Variables and Values

    In Python, we have variables and values. Think of a variable as a box, and a value as something that goes inside the box. Here is an example of a variable and its value:

    animal = “cat”

    In this case, animal is the variable, and “cat” is its value. In fact, it is a specific type of value--a string. A value that has letters or characters and no numbers is a string type value. We put strings inside quotation marks. When we write a variable, we are declaring the variable.

    In this case, we can say that we are assigning the value of “cat” to the variable animal. The = is called the assignment operator. It’s not an “equals” sign in the sense that 2 = 2, but it does convey a relationship. We are basically saying that animal represents “cat”. That means that when we do something with animal, we are doing something with “cat”.

    For example, look at this code:
    print(animal)

    The print function tells the program to print, or display, something in the output area of our code editor. A function is an action that we can do in Python. Keeping in mind that animal represents “cat”, what do you think we’ll see if we print the value of animal?

    Try it yourself: In the code editor on the right, declare a variable called animal. Then assign it a value, like “cat” (or another animal, if you’re not a cat person). Then tell the program to print the variable. Click the large gray triangle button at the top of the editor to run your program and see the results!

    You can also have multiple words as part of a single value. For example:

    favorite_song = “Somewhere Over the Rainbow”

    Try typing the above code in the editor and then printing favorite_song.

    Note that variable names are lowercase. Use underscores when you need to include multiple words, as in favorite_song, cat_name, and so on.

    Sometimes we might want to have more than one value assigned to a variable. We might want to have a list of values, for instance. In Python, we can make a list, also called an array. For example:

    animal = [“cat”, “dog”, “bird”, “fish”]

    “Cat”, “dog”, “bird”, and “fish” are all values in the array. In this example, they are all single-word strings. But you can have multiple-word strings as values in an array, as well:

    favorite_songs = [“Somewhere Over the Rainbow”, “Happy Birthday”, “Imagine”]

    What do you think would be the result if you typed the above line of code in your code editor and then printed favorite_songs? Try it and see!

  3. Step 3

    Now that we know how our metaphors fit the metaphor formula, we need to turn each part into code.

    First, we’ll split our noun phrases into variables and values. For each metaphor, we need to have two variables--noun phrase 1 and noun phrase 2. Because we have 3 metaphors, we’re going to make, or declare, a total of 6 variables with 6 accompanying values:

    noun_phrase_1a (“All the world”) and noun_phrase_1b (“a stage”);

    noun_phrase_2a (“Juliet”) and noun_phrase_2b (“the sun”);

    and noun_phrase_3a (“Dying”) and noun_phrase_3b (“a wild night”).

    On lines 2-7, type this code:

    noun_phrase_1a = “All the world”

    noun_phrase_1b = “a stage”

    noun_phrase_2a = “Juliet”

    noun_phrase_2b = “the sun”

    noun_phrase_3a = “Dying”

    noun_phrase_3b = “a wild night”

  4. Step 4

    Let’s create three more variables. On lines 9-11, write this code:

    metaphor_1 = noun_phrase_1a + “ is ” + noun_phrase_1b

    metaphor_2 = noun__phrase_2a + “ is ” + noun_phrase_2b

    metaphor_3 = noun_phrase_3a + “ is ” + noun_phrase_3b

    In the code above, we are joining together both noun phrases in each metaphor with “is”. We have a space on either side of “is” within the quotation marks so that we have enough space in each metaphor. We used the “+” to add together, or concatenate, the parts of our metaphors.

  5. Step 5

    To see the results of our Metaphor Maker, we need to use the print function. A function is an action we can do in Python. This function will “print” or display the output of the program. On lines 13-15, type this code:

    print(metaphor_1)
    print(metaphor_2)
    print(metaphor_3)

    Then run your program to see the results!

View Solution

Teaching Ideas

  • Key terms & concepts: metaphor, figurative language, Python, value, variable, module, random module, string, function, print function, array, concatenate
  • Discuss the similarities and differences between similes and metaphors.
  • Discuss different metaphor structures and how in this project we are just using one structure: noun phrase + is + noun phrase.
  • Discuss metaphor examples from literature you are reading in class. Have students use metaphors from their literature unit for this project instead of the metaphors given here.
  • Discuss why we use figurative language like similes and metaphors. How do these devices communicate an idea in a way that perhaps literal, non-figurative language doesn’t?
  • To explore metaphors further, have students find examples in popular culture, like song lyrics.
  • Have students come up with their own metaphors to use in this project. Students can generate ideas in small groups or as a class. If in small groups, have each student come up with 5-10 nouns and write them on index cards. Have the group look at all the words and see what pairings could be metaphors. Discuss the idea of abstraction; we’re looking for figurative similarity, not literal similarity. “A dog is an animal” is not a metaphor even though it’s two nouns joined by “is”.
  • Have students write critical analysis short responses or essays about the role of metaphors in a piece of literature.

Teaching Standards

ELA Common Core Standards (U.S.)

Reading Standards for Literature, 6-12–Grades 9-10 Students, #4(Pg 38):

  • Determine the meaning of words and phrases as they are used in the text, including figurative and connotative meanings; analyze the cumulative impact of specific word choices on meaning and tone (e.g., how the language evokes a sense of time and place; how it sets a formal or informal tone).

Reading Standards for Literature 6-12–Grades 11-12 Students, #4(Pg 38):

  • Determine the meaning of words and phrases as they are used in the text, including figurative and connotative meanings; analyze the impact of specific word choices on meaning and tone, including words with multiple meanings or language that is particularly fresh, engaging, or beautiful. (Include Shakespeare as well as other authors.)

Reading Standards for Informational Text 6-12

  • Grade 6 students #4 (Pg 39): Determine the meaning of words and phrases as they are used in a text, including figurative, connotative, and technical meanings.
  • Grade 7 students #4 (Pg 39): Determine the meaning of words and phrases as they are used in a text, including figurative, connotative, and technical meanings; analyze the impact of a specific word choice on meaning and tone.
  • Grade 8 students #4 (Pg 39): Determine the meaning of words and phrases as they are used in a text, including figurative, connotative, and technical meanings; analyze the impact of specific word choices on meaning and tone, including analogies or allusions to other texts.

Python References

For help with learning Python, check out these resources:

  • Think Java and Python for Everybody, both available for free at trinket.io
  • Head First Learn to Code: A Learner’s Guide to Coding and Computational Thinking by Eric Freeman
  • Impractical Python Projects: Playful Programming Activities to Make You Smarter by Lee Vaughan
  • Mosh Hamedani’s YouTube tutorial “Python Tutorial - Python for Beginners [2020]”
  • W3Schools.com - Website with information about many programming languages, including Python

Sitemap