Python 中的if elif else结构通常如下: if cond1: a=1 elif cond2: a=2 else: a=3. 在特殊情况下,我们可能希望把这个条件语句写成一行,如(列表推导式中)。
確定! 回上一頁