Madlibs Value Error


#1

https://www.codecademy.com/courses/learn-python/projects/madlibs

So here is the full code for my Madlibs exercise

print ("Welcome to Mad Libs!")
name = input("What is your name?")
adjective1 = input("Please choose an adjective.")
adjective2 = input("And another adjective...")
adjective3 = input("And one more adjective, please?")
verb1 = input("Now, if you would be so kind, a verb:")
noun1 = input("And a noun:")
noun2 = input("Just one more noun:")
animal = input("""Here is where it really gets fun!
What is your favorite animal?""")
food = input("What about your favorite food?")
fruit = input("Now, a specific type of food please - a fruit:")
superhero = input("OOOH! ooh! What about a superhero?")
country = input("And a country?")
dessert = input("What did you last eat for dessert?")
year = input("And a FINALLY a year, any random year.")
print (STORY % (name, adjective1, adjective2, animal, food, verb1, noun1, fruit, adjective3, name, superhero, name, country, name, dessert, name, year, noun2))
input ("Press enter")

Every time I try to run my program, I get the following error:

Traceback (most recent call last):
  File "C:/Users/Rachel/Desktop/Game dev class/Madlibs.py", line 28, in <module>
    print (STORY % (name, adjective1, adjective2, animal, food, verb1, noun1, fruit, adjective3, name, superhero, name, country, name, dessert, name, year, noun2))
ValueError: unsupported format character 'w' (0x77) at index 15

Can anyone help me figure out what I’ve done wrong? Sorry if it’s a super obvious fix, I’m very new to coding. I tried searching the forums a bit and I think I corrected some of the problems, but apparently not all of them haha


#2

We will need to see the STORY text to check your format placeholders. They should all read, %s.


#3

Whoops, sorry!

STORY = "This morning % woke up feeling %. 'It is going to be a % day!' Outside, a bunch of %s were protesting to keep % in stores. They began to % to the rhythm of the %, which made all the %s very %. Concerned, % texted %, who flew % to % and dropped % in a puddle of frozen %. % woke up in the year %, in a world where %s ruled the world."

#4

Be sure to pair up % with a format character so that it looks like, %s.