python编程中if 语句用于控制程序的执行,基本形式为:
if 判断语句:
执行语句
-------------------------------------------
if 判断语句:
执行语句
else:
执行语句
例子:
score = 80
if score >= 80:
print("Score is A")
if score >= 80:
print("Score is A")
elif score >= 70:
print("Score is B")
elif score >=60:
print("Score is C")
else:
print("Score is D ")