Python Forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pig Latin Translator
#1


def translate(text):
    return ' '.join('{}{}{}'.format(word, word[0], 'say')[1:] for word in text.split())

while 1:
    word = input('Enter some words: ')
    if word == 'quit':
        break
    print(translate(word))
python 2.7 will need raw_input how can I make this run on 2.7 and 3?
Reply
#2
what is your question? you resurrected a year-old thread...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  non-latin characters in console from clipboard Johanson 3 705 Oct-26-2023, 10:10 PM
Last Post: deanhystad
  (python) Can i get some help fixing a English to Morse translator? Pls AlexPython 7 1,619 Sep-12-2022, 02:55 AM
Last Post: AlexPython
  "If Len(Word) == 0" Code Block in Pig Latin Program new_coder_231013 3 2,081 Jan-02-2022, 06:03 PM
Last Post: deanhystad
  i want to write symbole as varibales in python to make translator rachidel07 9 3,532 Feb-03-2021, 09:57 PM
Last Post: nilamo
  Pressing non-latin characters? Murlog 0 1,539 Jul-25-2020, 03:10 PM
Last Post: Murlog
  letter translator (or someting) Obsilion 4 2,465 Apr-28-2020, 12:40 PM
Last Post: deanhystad
  I want to filter out words with one letter in a string (pig latin translator) po0te 1 2,110 Jan-08-2020, 08:02 AM
Last Post: perfringo
  Trouble with Regex Translator skrivver99 3 2,771 Dec-15-2018, 03:55 PM
Last Post: Gribouillis
  Output discrepancy when building Translator skrivver99 17 6,680 Nov-26-2018, 01:22 AM
Last Post: ichabod801
  Help with pig latin translator DragonG 1 2,275 Nov-01-2018, 03:57 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020