I have created a program that works fine but why does it not work when I type in two correct words ? Does the fuction lens() not consider two words? At exercise 5 , check yourself


#1



Replace this line with your code.


#2

please post your code.

If this is pyglatin, and you use .isalpha(), a space is not considered alphanumeric character.


#3

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"

and does the len() take two words into consideration ? Thanks :slight_smile:


#4

length is not the problem, as i already predicted the problem is in isalpha.

isalpha is only true for a till z (and uppercase), a space would be false. That is your problem

For this exercises, your translator should work for a single word, for multiply words should be attempted outside the exercise


#5

Okay, thanks :seedling:


#6