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

banner
Close banner
0 points
Submitted by AK
over 11 years

Solution: how to get past PygLatin: Check Yourself Bug

There is a bug on “Check Yourself” exercise where users (clearly) have the correct code but the system isn’t allowing them to pass.

The solution which worked for me (and for others) is to begin the if.. else.. statement on line 2 or 3.

I also deleted the line print “Welcome to Pig Latin…”

which may or may not be necessary in order to pass the system.

Answer 52e58431631fe948f2008ac9

1 vote

Permalink

The following code worked for me. I was stuck on this one for quite a while. original = raw_input("please enter a word.") if len(original) > 0: print "%s" % (original) else: print "empty, restart and enter a new word"

points
Submitted by Brian Davisson
about 10 years

1 comments

kmurphy541 almost 9 years

Also works as: print ‘Welcome to the Pig Latin Translator!’

original = raw_input(“Enter a word:”) if len(original) > 0: print original else: print “empty”

Answer 508344e81013010200000958

0 votes

Permalink

It didnt work for me I changed it to this and it still won’t print ‘Welcome to the English to Pig Latin translator!’ if size != 1: return True print original else: return False print ‘Empty’ print ‘Please enter a word’ original = raw_input(‘Enter a word’) size = len(original) even when i took out the welcome to pig latin

points
Submitted by Joshua Judd Porter
over 11 years

Answer 5155d20507cb92252e0000ee

0 votes

Permalink

so far I’m able to input a word. then it doesn’t finish.

so this is my code:

original = raw_input("please enter a word.")

if len(raw_input) > 0: print origianl else: print “empty, restart and enter a new word”

this is what it’s telling me

Traceback (most recent call last):
  File "python", line 2, in <module>
TypeError: object of type 'builtin_function_or_method' has no len()

I’ve tried it with len(original) as well and it tells me

NameError: name 'origianl' is not defined

when I clearly define it.

I just tried

    original = raw_input("please enter a word.")
if len(origianl) > 0:
    print "%s" % (original)
else:
    print "empty, restart and enter a new word"

still no luck…

points
Submitted by citronrobotlord
about 11 years

1 comments

HoundDog over 10 years

You spelled original wrong in your if statement.