英语语法中动词的第三人称单数形式规则简要如下,如果动词以y字母结尾,则去掉y加上ies如果动词以o,ch,s,sh,x,z字母结尾,则加上es,默认直接在动词最后加上字母s。写一个程序,对于任意给定的一个动词返回其第三人称单数形式。
3条回答 默认 最新
- 技术专家团-小桥流水 2023-01-02 00:09关注
代码如下:
def myfun(s): n = len(s) if s.endswith('y'): s1 = s[0:n - 1] s1 = s1 + 'ies' print(s1) elif s.endswith('o') or s.endswith('ch') or s.endswith('s') or s.endswith('sh') or s.endswith('x') or s.endswith('z'): s1 = s + 'es' print(s1) else: s1 = s + 's' print(s1) s = input() myfun(s)
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报 编辑记录