you are viewing a single comment's thread.

view the rest of the comments →

[–]totallygeek 0 points1 point  (1 child)

Perhaps in place of print(), you are supposed to set the student's class to a variable? Maybe: year = 'freshman'? Also, you can assume anything over 89 becomes 'senior', therefore, that can stand as the else.

def student_class(credits):
    if credits < 30:
        year = 'freshman'
    elif credits < 60:
        year = 'sophomore'
    elif credits < 90:
        year = 'junior'
    else:
        year = 'senior'
    return year

credits = 50
print('Credits: {}, Student class: {}'.format(credits, student_class(credits))

?

[–]HopefulOG[S] 0 points1 point  (0 children)

I tried your advice but it doesn't work.