当前位置: 代码迷 >> 综合 >> 语句:a if condition else b
  详细解决方案

语句:a if condition else b

热度:22   发布时间:2023-11-29 11:26:54.0

标准语句:a if condition else b .判断条件大于0,选择a,反之,选择b。

e.g. step = 1 if random.randint(0, 1) else -1(利用python进行数据分析120页)

  相关解决方案