python if语句

doubinning 2020-05-03

code

num = 4
if num > 0:
    print("正数")
elif num == 0:
    print("零")
else:
    print("负数")
# 内嵌 if 语句
if num >= 0:
    if num == 0:
        print("零")
    else:
        print("正数")
else:
    print("负数")

相关推荐

zhuxianfeng / 0评论 2020-02-09