1、if 判断
写法1:
score = int(input('input score: '))
if 90 <= score <= 100:
print('A')
if 80 <= score < 90:
print('B')
if 60 <= score < 80:
print('C')
if 0 <= score < 60:
print('D')
if score < 0:
print('输入错误')
if score > 100:
print('输入错误')
写法2:
score = int(input('input score: '))
if 90 <= score <= 100:
print('A')
else:
if 80 <= score < 90:
print('B')
else:
if 60 <= score < 80:
print('C')
else:
if 0 <= score < 60:
print('D')
else:
print('输入错误')
写法3:
score = int(input('input score: '))
if 90 <= score <= 100:
print('A')
elif 80 <= score < 90:
print('B')
elif 60 <= score < 80:
print('C')
elif 0 <= score < 60:
print('D')
else:
print('输入错误')