Untitled
unknown
python
a year ago
1.1 kB
6
Indexable
def translate_to_lakanese(word): # Mapping of English vowels to Lakanese translation_map = {'a': 'aka', 'e': 'eke', 'i': 'iki', 'o': 'oko', 'u': 'uku'} # Translate each vowel in the word to its Lakanese equivalent translated_word = '' for letter in word: if letter in translation_map: translated_word += translation_map[letter] else: translated_word += letter return translated_word def translate_phrase_to_lakanese(): # Prompt the user for a phrase phrase = input("Please enter a phrase to translate into Lakanese: ") words = phrase.split() # Translate each word in the phrase translated_words = [translate_to_lakanese(word) for word in words] # Join the translated words back into a phrase translated_phrase = ' '.join(translated_words) return translated_phrase # Call the function to translate a user-entered phrase translated_phrase = translate_phrase_to_lakanese() print("Translated phrase in Lakanese:", translated_phrase)
Editor is loading...
Leave a Comment