一、简单逻辑

if condition1:
    statement1
else:
    statement2

(5)条件语句

 

二、多条件逻辑

if condition1:
    statement1
elif condition2:
    statement2
...
elif conditionN:
    statementN
else:
    statement

(5)条件语句

三、三元运算 

[on_true] if [expression] else [on_false]

(5)条件语句

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-09
  • 2022-02-22
  • 2021-07-30
猜你喜欢
  • 2021-11-14
  • 2021-06-11
  • 2021-07-11
  • 2022-02-21
  • 2022-12-23
  • 2021-05-09
相关资源
相似解决方案