Why can't I do the same for sentence, i.e, Pig Latin game?


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:len(new_word)]
print new_word
print 'empty'


What are you asking?
You could definitely do it for a sentence, but you would need to:

a) turn the input into an array
b) use a 'for' loop to iterate over that array


could you please write the code to perform that thing.


Consider which steps need to be done and implement them one by one. Use google if you need to know how to do something specific, like split a sentence into words


No. What would you learn if everyone did it for you?