Pig Latin

class practiceYln():
    def __init__(self):
        self.text = None

    def piglatin(self, text):
        if text[0] in ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']:
            print(text[1:] + '' + 'way')
        else:
            print(text[1:] + '' + text[0] + 'ay')

tt = practiceYln()
tt.piglatin('banana')
tt.piglatin('echo')

# 结果:
anana—bay
cho—way

 

posted @ 2020-03-27 11:18  YlnChen  阅读(95)  评论(0编辑  收藏  举报