This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by GiselaLima
almost 9 years

SyntaxError: EOF while scanning triple-quoted string literal

Cannot figure out why I did wrong

1.print ‘Welcome to the Pig Latin Translator!’

2.original = raw_input(“Enter a word”)

3.print original

4.empty_string = “””

5.if len(original) > 0:

  • print “original”

6.else (original) == 0:

  • print “empty”

Answer 532a242e7c82ca4d3b0001a3

0 votes

Permalink

What is this line for: 4.empty_string = “”” ? We need to see format to help debug, follow this post and then upload again http://imgur.com/gallery/MyteV

points
Submitted by James
almost 9 years

Answer 532b0b859c4e9d703600271e

0 votes

Permalink

Thanks, James! Just copy paste will give this:

print ‘Welcome to the Pig Latin Translator!’

original = raw_input(“Enter a word”)

print original

empty_string = “””

if len(original) > 0:

print “original”

else (original) == 0:

print “empty”

points
Submitted by GiselaLima
almost 9 years

Answer 532b0c427c82ca8a79002b7c

0 votes

Permalink

I Fixed the triple quotation mark on line 7, and now the error is

File “python”, line 13 else (original) = 0: ^ SyntaxError: invalid syntax

and also Oooops, have you incidentally deleted the variable called original?

points
Submitted by GiselaLima
almost 9 years

Answer 532d28189c4e9da4ee0025ac

0 votes

Permalink

Any clues?

points
Submitted by GiselaLima
almost 9 years

Answer 532f62aa631fe93519007f76

0 votes

Permalink

else doesn’t get checked against anything, it is what is run if everything else is false. Either change it to an elif or keep it as an else but remove the comparison (original == 0)

points
Submitted by James
almost 9 years

Answer 5334a48f7c82ca8e7f00086b

0 votes

Permalink

print original shouldn’t have speech marks, it’s a variable.

points
Submitted by Daniel Jurd
almost 9 years