代码示例:(标识:python_if_nested)
python_if_nested.py
x = 52

if x > 10:
  print("Above ten,")
  if x > 20:
    print("and also above 20!")
  else:
    print("but not above 20.")
运行结果: