Created
June 10, 2017 17:21
-
-
Save sholok404/37edbb8a02052fdd02e324e9fb1be9eb to your computer and use it in GitHub Desktop.
An english to pig latin translator made without the use of machine learning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| An english to pig latin translator made without the use of machine learning. | |
| """ | |
| s = input('Enter a string to translate to Pig Latin: ') | |
| end = '' | |
| vowels = ['a', 'e', 'i', 'o', 'u'] | |
| n = 0 | |
| for i in range(len(s)): | |
| if s[i] in vowels: | |
| n = i | |
| break | |
| else: | |
| end += s[i] | |
| print(s[n:]+end+'ay') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment