gpt4 book ai didi

python - 我该怎么做 variable.endswith ("a"或 "b"或 "c"....) : doAThing in Python?

转载 作者:行者123 更新时间:2023-12-02 00:13:35 25 4
gpt4 key购买 nike

<分区>

我正在开发一个处于早期阶段的小翻译软件。我正在尝试获取单词的结束字符并对其进行处理,但我需要区分不同的情况。

如何使用 if endswith("a"or "b"or "c") : doAThing

我已经尝试过 |||=or

if word.endswith("a" , "e" , "i" , "o" , "u") : print("JEFF")

错误:

 File "test.py", line 50, in <module>
if word.endswith("a" , "e" , "i" , "o" , "u") and not ("a" , "e" , "i" , "o" , "u"): print("JEFF")
TypeError: endswith() takes at most 3 arguments (5 given)

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com