- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildingATranslator.py
More file actions
Latest commit
23 lines (18 loc) · 777 Bytes
/
Copy pathBuildingATranslator.py
File metadata and controls
23 lines (18 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#Any vowel in the input phrase gets converted to letter g using the following function:
deftranslator_vowel_to_g(phrase):
translated_phrase=""
forletterinphrase:
ifletterin"AEIOUaeiou":
ifletter.islower():
translated_phrase=translated_phrase+'g'
else:
translated_phrase=translated_phrase+'G'
else:
translated_phrase=translated_phrase+letter
returntranslated_phrase
print(translator_vowel_to_g(input("Enter The Phrase: ")))
cnt=input("Do you want to continue?(Yes/No): ")
whilecnt=="Yes" :
print(translator_vowel_to_g(input("Enter The Phrase: ")))
cnt=input("Do you want to continue?(Yes/No): ")
print("Thank you for using the translator!")