plz help code practice for python

Input a grade number [9-12] and print Freshman, Sophomore, Junior, or Senior. If it is not in [9-12], print Not in High School.

Hint: Since this lesson uses else-if statements, remember to use at least one else-if statement in your answer to receive full credit

Sample Run 1
What grade are you in? 10
Sample Output 1
Sophomore
Sample Run 2
What grade are you in? 5
Sample Output 2
Not in High School

Respuesta :

rpotus

Answer:umm

Explanation:

Answer:

grade = int(input())

grade = "Freshman" if grade == 9 else "Sophomore" if grade == 10 else "Junior" if grade == 11 else "Senior" if grade == 12 else "Not in High School"

print(grade)

Explanation:

One liner if-elif-elif-else statement. Tested it, works just fine.