Skip to main content
 首页 » 编程设计

Python if a = this 或 this 或 this

2025年05月04日8arxive

<分区>

如果我有一个函数:

if a_string == "a" or a_string == "b" or a_string == "c": 
    # do this 

如果没有重复的 or 语句,我怎么能写出不同的东西呢?或者这是最好的方法吗?