Python includes exercises 56

Copyright: All rights reserved Please indicate the link! https://blog.csdn.net/qq_43558971/article/details/91493925

Title: using nested conditional operator to complete this question: academic> = 90 points represented by students A, B is represented by between 60-89 minutes is represented by C 60 points or less.

# -*- coding: UTF-8 -*-
 
score = int(raw_input('输入分数:\n'))
if score >= 90:
    grade = 'A'
elif score >= 60:
    grade = 'B'
else:
    grade = 'C'
 
print '%d 属于 %s' % (score,grade)

Guess you like

Origin blog.csdn.net/qq_43558971/article/details/91493925