<分区> 分区>
我正在尝试获取用户输入的字符串,如果它以 'ion' 结尾,则替换该字符串的最后三个字符并添加一个 'e' .
def ion2e(s):
if s[-3:]=='ion':
print (s[-3:]+'e')
else:
print (s)
<分区> 分区>
我正在尝试获取用户输入的字符串,如果它以 'ion' 结尾,则替换该字符串的最后三个字符并添加一个 'e' .
def ion2e(s):
if s[-3:]=='ion':
print (s[-3:]+'e')
else:
print (s)