Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Grading program using if else

print("Grade List")
print ("==========")
def gradeAssign(marks):
    assert marks>=0 and marks<=100
    
    if marks>=90:
        grade="A"
    elif marks>=70:
        grade="B"
    elif marks>=50:
        grade="C"
    elif marks>=40:
        grade="D"
    else:
        grade="F"
    
    return grade
    
def main():
    marks = float(input('Enter your marks: '))
    print("Marks: ", marks, "
Grade: ", gradeAssign(marks))
    
main()
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Grading #program
ADD COMMENT
Topic
Name
8+5 =