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


#1

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
else:
print 'empty'


#2

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


#3

could you please write the code to perform that thing.


#4

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


#5

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