""" @Author : 李晓华 (北京大学) @Email : chinapkulxh@pku.edu.cn @Project : 数据科学实战系列课程 @lecture : Python预科班 @Organization : 光环国际 (http://aura.cn/) """ """ 1,顺序,分支,循环 2,分支 if """ age = 8 if age >= 18: print("成年啦") else: print("未成年") """ 1,< 60: 挂了 2,60 - 75:及格 3, 76 - 85:良好 4,86 - 100:优秀 """ score = 38 if score < 60: print("挂了") elif score <= 75: print("及格") elif score <= 85: print("良好") else: print("优秀") """ 1,三元表达 """ age = 9 result = "成年" if age >= 18 else "未成年" print(result)