Pig Latin


#1

so i finished my code but i cant seem to be able to use spaces when using pig latin, whenever i do it returns ‘empty’ as if my text had <0
Here is my code

**pyg = 'ay'**

**original = raw_input('Enter a word:')**

**if len(original) > 0 and original.isalpha():**
**  word = original.lower()**
**  first = word[0]**
**  new_word = word + first + pyg**
**  new_word = new_word[1:]**
**  print new_word**
**else:**
**    print 'empty'**

#2

spaces is not a alphanumeric character should isalpha gives false

this translator only is capable of translating a single word into pyglatin


#3

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