The enigmatic "story not defined" error


#1



The error I ran into was
Traceback (most recent call last):
File "Madlibs.py", line 34, in
print Story % (adj1, person, verb1, adj2, noun1, noun2, animal, food, verb2
, noun3, fruit, adj3, person, verb3, number, person, superheo, superheo, person
, country, person, dessert, person, year, noun4)
NameError: name 'Story' is not defined


Ideally, it's supposed to print out a story right?


# This program helps the user practice input output 
# using madlibs. Madlibs is a story with blank
# spaces that the user fills out!
print "The program has now begun! Urahahah, let the games begin!"
person = raw_input('Enter your name: ')
print 'Hello', person

adj1 = raw_input('Enter an adjective: ')
adj2 = raw_input('Enter an adjective: ')
adj3 = raw_input('Enter an adjective: ')

verb1 = raw_input('Enter a verb: ')
verb2 = raw_input('Enter a verb: ')
verb3 = raw_input('Enter a verb: ')

noun1 = raw_input('Enter a noun: ')
noun2 = raw_input('Enter a noun: ')
noun3 = raw_input('Enter a noun: ')
noun4 = raw_input('Enter a noun: ')

animal = raw_input('Enter an animal: ')
food = raw_input('Enter a food: ')
fruit = raw_input('Enter a fruit: ')
number = raw_input('Enter a number: ')
superheo = raw_input('Enter a superhero name: ')
country = raw_input('Enter a country: ')
dessert = raw_input('Enter a dessert: ')
year = raw_input('Enter a year: ')


#The template for the story
STORY = "This morning I woke up and felt %s because %s was going to finally %s over the big %s %s. On the other side of the %s were many %ss protesting to keep %s in stores. The crowd began to %s to the rythym of the %s, which made all of the %ss very %s. %s tried to %s into the sewers and found %s rats. Needing help, %s quickly called %s. %s appeared and saved %s by flying to %s and dropping %s into a puddle of %s. %s then fell asleep and woke up in the year %s, in a world where %ss ruled the world." 

print Story % (adj1, person, verb1, adj2, noun1, noun2, animal, food, verb2, noun3, fruit, adj3, person, verb3, number, person, superheo, superheo, person, country, person, dessert, person, year, noun4)


#2

Hi @codeslayer12135 ,

You defined STORY, but then used the name Story, instead, in your final line of code. Since names are case-sensitive in Python, the two names are not equivalent.


#3

This morning I woke up and felt Strong because JoJo was going to finally Hamon
attack over the big Fabulous fuzzy hat. On the other side of the beefcake were
many bears protesting to keep guacamole in stores. The crowd began to power thr
ow to the rythym of the serenity, which made all of the prickly pears very Char
ismatic. JoJo tried to punched into the sewers and found 159 rats. Needing help
, JoJo quickly called Batman. Batman appeared and saved JoJo by flying to Japan
and dropping JoJo into a puddle of Cheesecake. JoJo then fell asleep and woke
up in the year 1222, in a world where powers ruled the world.

Awesome it worked! Thanks for the help.


#4