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
May we all proceed with wisdom and grace.
https://www.cnblogs.com/YlnChen/