Not enough arguments for format strings!


I don't see any syntax error. any clarification?

Everything looks good to me

#Python Mad Libs story
print "Mad Libs has started"
sname = raw_input("Enter your name: ")

first_adj = raw_input("Enter an adjective: ")
second_adj = raw_input("Enter a second adjective: ")
third_adj = raw_input("Enter one more adjective: ")

first_verb = raw_input("Enter a verb: ")
second_verb = raw_input("Enter a second verb: ")
third_verb = raw_input("Enter one more verb: ")

first_noun = raw_input("Enter a noun: ")
second_noun = raw_input("Enter a second noun: ")
third_noun = raw_input("Enter a third noun: ")
fourth_noun = raw_input("Enter one more noun: ")

animal = raw_input("Enter an animal: ")
food = raw_input("Enter food item: ")
fruit = raw_input("Favourite fruit: ")
number = raw_input("What's your number: ")
superhero_name = raw_input("Enter your superhero name: ")
country = raw_input("Enter your country: ")
dessert = raw_input("What dessert you like: ")
year = raw_input("Enter your birth 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 %s protesting to keep %s in stores. The crowd began to %s to the rythym of the %s, which made all of the %s 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 %s ruled the world."

print STORY % (first_adj, sname, first_verb, second_adj, first_noun, second_noun, animal, food, second_verb, third_noun, fruit, third_adj, sname, third_verb, number, sname, superhero_name, sperhero_name, sname, country, sname, dessert, sname, year, fourth_noun)


It's good practice to put parenthesis around what's being printed in print statements, but that shouldn't produce an error...

I don't see anything either. Maybe try replacing raw input with the type of input? (String is just input(prompt), int is int(input(prompt)) ).

Other than that I don't see anything. Check your variable names for typos. It'd be good if you provided the Syntax error.


In your print statement the second time you reference superhero_name you are missing the letter "u" so it's looking for "sperhero_name".


@mkordik Looks like I got it! :stuck_out_tongue:


Haha when in doubt check for typo's!


Rule 1 of programming!


Thanks guys, I put the "u" in the variable superhero_name and it was solved


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.