print 'Welcome to the Pig Latin Translator!'
# Start coding here!
original = raw_input('Enter a word:')
if len(original)>0 and original.isalpha():
print original
else:
print "empty"
On writing the input when I insert a space in between my input, the program gives the output as “Empty”. Why is that? Shouldn’t it print the word including space?
Presumably you’re getting empty back because one of your conditions evaluates to False.
You should take a look at the docs for the string method isalpha(). It tests for a very specific definition of “letter”, which a space does not meet, as we can easily test for:
>>> test = " "
>>> test.isalpha()
False
Given you’re building a pig latin translator, one assumes you’ll eventually expand your code to the point where you’ll deal with spaces in some fashion anyway.
Also, you’ll notice that I’ve edited your post to correctly format your code. You should read this thread about how to do this, so you can format code correctly for any future questions. This preserves the whitespace and indenting, which is crucial in Python!