SyntaxError: EOF while scanning triple-quoted string literal


#1


<$ python Madlibs.py
File "Madlibs.py", line 48
print STORY % (adjective1, name, verb1, adjective2, noun1, noun2, animal, f
ood, verb2, noun3, fruit, adjective3, name, number, name, Hero, Hero, name, Cou
ntry, name, Dessert, name, Year, noun4)

                                  ^

SyntaxError: EOF while scanning triple-quoted string literal
$
.>


"""This programme prompts users to fill the blanks for the story that is given below""""""

print= "Let's Begin"

name = raw_input("Enter a name: ")

adjective1 = raw_input("Enter an adjective: ")
adjective2 = raw_input("Enter a second adjective: ")
adjective3 = raw_input("Enter a final adjective: ")

Verb1 = raw_input("Enter a verb now: ")
Verb2 = raw_input("Enter a second verb: ")
Verb3 = raw_input("Enter a final verb: ")

noun1 = raw_input("Enter a noun buddy: ")
noun2 = raw_input("Enter a second noun: ")
noun3 = raw_input("Enter a final noun: ")

animal = raw_input("Enter your favourite animal: ")
food = raw_input("Enter your favourite food: ")
fruit = raw_input("Enter your favourite fruit: ")
number = raw_input("Enter a random number: ")
Hero = raw_input("Enter your favourite superhero: ")
Country = raw_input("Enter the country that you live in: ")
Dessert = raw_input("Enter your favourite dessert: ")
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. On the other side of the %s were many %ss protesting to keep %s in stores. The crowd began to %s to the rythem 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 _ 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 % (adjective1, name, verb1, adjective2, noun1, noun2, animal, food, verb2, noun3, fruit, adjective3, name, number, name, Hero, Hero, name, Country, name, Dessert, name, Year, noun4)


#2

"""This programme prompts users to fill the blanks for the story that is given below""""""

Three quotation marks on the left, six on the right, why? It should be:

"""This programme prompts users to fill the blanks for the story that is given below"""

And correct syntax for print is:

print message

#4

Thank you very much! Your correction fixed it. I'm a noob here. hehe. No background in code at all.


#5

You're very welcome :slight_smile: So this is the right place for you :slight_smile:


#6

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