4/11: Help! I've got stuck!


#1



Help, folks! My code doesn't let me pass. Here is it:


print 'Welcome to the Pig Latin Translator!'
word = raw_input("Enter a word: ")
original = raw_input()
if len(original) > 0:
    print original
    else:
    print "empty"


#2

Use proper indentation:

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

Indentation/Preformatted text not working in the comment for an unknown reason. Anyway you indent the code in Python. Now it's back.


#3

It shows up just like you wrote it! :P


#4

Yup!! It was not showing before now it's back. Not a wonder, sometimes my comment get modified when I don't do it myself. magic!!


#5

sneaky mods


#6

If I press Enter without typing any characters in is supposed to read "error"? Because I'm trying to test it to ensure that it works but it's not saying error when I hit enter without any characters


#7

It should show Empty not error. Notice the line:

Else:
      print "Empty"

#8

Dont know what I am overlooking here:

print ‘Welcome to the Pig Latin Translator!’

Start coding here!

raw_input ("Enter a word: ")
original = raw_input

if len(original) > 0:
print original
else:
print “Empty”


#9

This is the error i am getting:

Welcome to the Pig Latin Translator!
Enter a word: A
Traceback (most recent call last):
File “python”, line 7, in
TypeError: object of type ‘builtin_function_or_method’ has no len()


#10

I was having the same issue, I modified my code to read:

 original = raw_input("Enter a word: ")

 if len(original) > 0:
   print original

 else:
   print "empty"

#11

Hello I am also stuck here in 4/11
So I have this:

Start coding here!

original = raw_input(“Enter a word:”)

if len(original) > 0:
print raw_input

else:
print (“empty”)

The in the console window I get this:

Welcome to the Pig Latin Translator!
Enter a word:
( blinking white box)

When I try to type text I am not able to write anything on the console window