Answer:
sentence = input('Enter a Sentence: ').lower()
words = sentence.split()
for i, word in enumerate(words):
'''
if first letter is a vowel
if word[0] in 'aeiou':
words[i] = words[i]+ "ay"
else:
else get vowel position and postfix all the consonants
present before that vowel to the end of the word along with "ay"
has_vowel = False
for j, letter in enumerate(word):
if letter in 'aeiou':
words[i] = word[j:] + word[:j] + "ay"
has_vowel = True
break
#if the word doesn't have any vowel then simply postfix "ay"
if(has_vowel == False):
pig_latin = ' '.join(words)
print("Pig Latin: ",pig_latin)
Step-by-step explanation:
Answer. Answer: the conclusion of the story The fun they had is to build comparison in order to education of pas and present times.
Copyright © 2024 EHUB.TIPS team's - All rights reserved.
Answers & Comments
Verified answer
Answer:
sentence = input('Enter a Sentence: ').lower()
words = sentence.split()
for i, word in enumerate(words):
'''
if first letter is a vowel
'''
if word[0] in 'aeiou':
words[i] = words[i]+ "ay"
else:
'''
else get vowel position and postfix all the consonants
present before that vowel to the end of the word along with "ay"
'''
has_vowel = False
for j, letter in enumerate(word):
if letter in 'aeiou':
words[i] = word[j:] + word[:j] + "ay"
has_vowel = True
break
#if the word doesn't have any vowel then simply postfix "ay"
if(has_vowel == False):
words[i] = words[i]+ "ay"
pig_latin = ' '.join(words)
print("Pig Latin: ",pig_latin)
Step-by-step explanation:
it's Naman here ✌️
Answer:
Answer. Answer: the conclusion of the story The fun they had is to build comparison in order to education of pas and present times.