Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def student(name,sub1,sub2):
avg_marks = (sub1+sub2)/2
if avg_marks >= 80:
print("%s is very good student with marks %d" %(name,avg_marks))
## Checking condition if marks is in range(60,80) then student is average. elif (avg_marks<80 and avg_marks> 60):
print("%s is average student with marks %d" % (name,avg_marks))
## Checking condition if marks is below 60 then needs improvement
else:
print("%s needs improvement %d" % (name,avg_marks))
student('Ram', 80, 90)
#[Output]:
#Ram is very good student with marks 85
student('Seeta',50,30)
#[Output]:
#Seeta needs improvement 40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.