if elif else

# -*- coding:utf-8 -*-
#!/usr/bin/env python3
age = int(input("age is:"))
if age > 18 :
    print("已经成年")
elif age < 12 :
    print("小于12岁")
else:
    print("未成年")

python里面是根据冒号和对齐行来控制代码块的

posted @ 2020-04-19 08:26  ChenduLaoWang  阅读(114)  评论(0)    收藏  举报