Skip to content

Instantly share code, notes, and snippets.

@sholok404
Created June 10, 2017 17:21
Show Gist options
  • Select an option

  • Save sholok404/37edbb8a02052fdd02e324e9fb1be9eb to your computer and use it in GitHub Desktop.

Select an option

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.
"""
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