TypeError: not enough arguments for format string


#1



'''Mad libs is a fun text game and this requires me to make a multi line comment like this one '''
print "Mad libs has started"

mainc = raw_input("enter a name: ")
adjective1 = raw_input("Enter an adjective: ")
adjective2 = raw_input("Enter another adjective: ")
adjective3 = raw_input("Enter the last adjective: ")
verb1 = raw_input("give me a verb: ")
verb2 = raw_input("give me another verb: ")
verb3 = raw_input("give me a last verb verb: ")
noun1 = raw_input("give me a noun: ")
noun2 = raw_input("give me another: ")
noun3 = raw_input("Dont hate me please, just another one: ")
noun4 = raw_input("I was joking this is the last one: ")
animal = raw_input("give me an animal: ")
food = raw_input("Give me a nasty meal: ")
fruit = raw_input("A fruit: ")
number = raw_input("a number: ")
hero = raw_input("a marvel character: ")
country = raw_input("your favorite country: ")
dessert = raw_input("some candy: ")
year = raw_input("a year: ")
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 % (adjective1, mainc, verb1, adjective2, noun1, noun2, animal, food, verb2, noun3, fruit, adjective3, number, mainc, hero, hero, mainc, country, mainc, dessert, mainc, year, noun4)

I really don't know what is happening with my code but it gives me the error in the title of the issue.


#2

Hi, @migue897 ,

To find the cause of the error message, examine the final two statements of your code. The tuple in the final statement need to contain enough values to match each of the %s format specifiers in the STORY string.


#3

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