fork(12) download
  1. def piglatin(sentence):
  2. """
  3. piglatin(str) -> new str
  4. """
  5. return ' '.join(word[2:]+word[:2]+'ay' for word in sentence.split())
  6.  
  7. print 'frog ->', piglatin('frog')
  8. print "\nTODO: Make piglatin(sentence) work properly for cases like the following:\n"
  9. print 'happy ->', piglatin('happy')
  10. print 'Spanish Inquisition! ->', piglatin('Spanish Inquisition!')
Success #stdin #stdout 0.02s 4676KB
stdin
Standard input is empty
stdout
frog -> ogfray

TODO: Make piglatin(sentence) work properly for cases like the following:

happy -> ppyhaay
Spanish Inquisition! -> anishSpay quisition!Inay