Skip to content

Instantly share code, notes, and snippets.

@Robofied
Created February 3, 2019 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Robofied/b6a22fab09908c9b474a6bafaafa1615 to your computer and use it in GitHub Desktop.
Save Robofied/b6a22fab09908c9b474a6bafaafa1615 to your computer and use it in GitHub Desktop.
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