What's wrong in this code? (python)


#1

print ‘Welcome to the Pig Latin Translator!’

Start coding here!

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


#2

Dunno, you tell us.
And, if you want us to see your code, we’ll need an exact copy. If we can’t copy it and get the same outcome then we’re not discussing the same code…


#3

i have given the copy above int the question


#4

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


#5

What error does the console flash when you run the code?


#6

@datawhiz35235 first off it would be easier for people to know the situation of what exact part you currently are trying to work on. I’m assuming you are on 4/11 of PygLatin, because that is the first one that introduces the if statement?

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
original = raw_input("Enter a word:")
if len(original) > 0:
  print original
else:
  print "empty"

The only thing I can see wrong with the code is the Indentation.
You didn’t post a formatted text tho, so I’m not exactly sure if that’s your case, but I can’t see anything else really wrong with it except that.


#7

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