Awesome ! I was curious so I tried to implement it too in my free time, here is my a-little-more-concise solution !
defto_pig_latin(word:str)->str:"""convert a word to piglatin
:param word: word to convert
:return: the pigralitine version of the word
"""ifword[0]in'aeiou':complementary='way'else:complementary=f'{word[0]}ay'returnf'{word[1:]}{complementary}'if__name__=='__main__':words=['Dog','Nyx','Puppy','Gizmo','Kitten','Luna-fish','Tuna-fish','Apple','Orange',]forwordinwords:print(f'{word} is {to_pig_latin(word).title()} in piglatin')
Oh thats good! Mine was meant to be entirely run inside this article using orgmode and such. I totally forgot to set it up so that you can tangle the file out.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Awesome ! I was curious so I tried to implement it too in my free time, here is my a-little-more-concise solution !
Oh thats good! Mine was meant to be entirely run inside this article using orgmode and such. I totally forgot to set it up so that you can tangle the file out.