python中if elif条件语句实用范例
marks = 99 if marks >= 90: grade = 'A' elif marks >= 80: grade = 'B' elif marks >= 70: grade = 'C' elif marks >= 60: grade = 'D' else: grade = 'F' print(grade)
python中if elif条件语句实用范例
marks = 99 if marks >= 90: grade = 'A' elif marks >= 80: grade = 'B' elif marks >= 70: grade = 'C' elif marks >= 60: grade = 'D' else: grade = 'F' print(grade)