我正在尝试使用猪拉丁式设置。辅音的规则是取字符串的第一个字母,将其移到末尾并添加ay。我的问题是我要删除第一个字母并将其移到末尾...我不确定如何同时执行此操作。谢谢你。
pyg = 'ay'
original = raw_input('Enter a word:')
word = original.`enter code here`lower()
first = original[0]
if len(original) > 0 and original.isalpha():
if first == "a" or "e" or "i" or "o" or "u" or "A" or "E" or "I" or "O" or "U":
print("vowel")
new_word = original.append(pyg)
else:
print("consonant")
new_word = (word.pop[0] and word.append(word[0]) + str(pyg)
print original
else:
print 'empty'