# python中return 两种场景 # 01:标识着一个函数是有返回值的函数 def add2num(a, b): return a + b
# 02: 提前结束函数的调用 # def score_desc(score): # # 判断分数是否合法 # if score > 100 or score < 0: # print("您传入的分数不合法...") # else: # # 判断 # if score >= 90: # print("优") # elif score >= 80: # print("良") # elif score >= 60: # print("中") # elif score >= 0: # print("差") def score_desc(score): # 判断分数是否合法 if score > 100 or score < 0: print("您传入的分数不合法...") return print("测试") # 判断 if score >= 90: print("优") elif score >= 80: print("良") elif score >= 60: print("中") elif score >= 0: print("差") score_desc(90)