if xxx有值

num = None

# 如果num有值
if num:
    print("haha")
else:
    print("没有值")

  

猜你喜欢

转载自www.cnblogs.com/yzg-14/p/12319089.html
xxx