1

私は初期段階の小さな翻訳ソフトウェアに取り組んでいます。単語の末尾の文字を取得して何かを実行しようとしていますが、さまざまなケースを区別する必要があります。

どのように使用できます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)
4

1 に答える 1