a=-3
if a>0:
print("this numher is greater than0")
if a<0:
print("this number is less than or equol to 0")
为了便快捷的写出代码,今天我们学习了如何使用if-else来优化程序。下面试试,便用if-else来简化以下的代码
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- 「已注销」 2023-04-24 09:34关注
a = -3 if a > 0: print("this number is greater than 0") else: print("this number is less than or equal to 0")评论 打赏 举报解决 1无用