Created
March 6, 2012 23:49
-
-
Save nadia2012/1989866 to your computer and use it in GitHub Desktop.
ex 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#done by nadia , wojod , sara , marwa | |
class_data = [ | |
{"name":"Mohammed Abdulla", "id":2008021080, "grade":91, }, | |
{"name":"Ali Ahmad", "id":2009011022, "grade":68, }, | |
{"name":"Ahmad Mohammad", "id":2008011085, "grade":74, }, | |
{"name":"Salem Sulaiman", "id":2007011033, "grade":97, }, | |
{"name":"Sara Fareed", "id":2008011003, "grade":85, }, | |
{"name":"Maha Khaled", "id":2006021087, "grade":93, }, | |
{"name":"Mneera Abdulla", "id":2008011019, "grade":60, }, | |
{"name":"Abdulaziz Ali", "id":2008021020, "grade":75, }, | |
{"name":"Sami Hamad", "id":2007011095, "grade":50, }, | |
{"name":"Maryam Ahmad", "id":2009011076, "grade":73, }, | |
{"name":"Mohammed Jasem", "id":2008021041, "grade":81, }, | |
] | |
for x in class_data: | |
print x["name"],x["id"],x["grade"] | |
if x["grade"] > 90 : | |
print "leter grade is A " ,x["name"],"you Passed" | |
elif x["grade"] > 80 : | |
print "leter grade is B " ,x["name"],"you Passed" | |
elif x["grade"] > 70 : | |
print "leter grade is c " ,x["name"],"you Passed" | |
elif x["grade"] >60 : | |
print "leter grade is D " ,x["name"],"you Passed" | |
else: | |
print "leter grade is F " ,x["name"],"you Fialied" | |
def avreg ( dict-sum,dict-length) | |
dict-sum = sum(x["grade"]) | |
dict-length=len(x["grade"]) | |
dict-avreg= dict-sum/dict-length | |
print "theavreg is ",dict-avreg | |
ruturn; | |
def max (x["grade"]): | |
max-grade = max(x["grade"]) | |
print max-grade | |
return; | |
def min (x["grade"]): | |
min-grade = min (x["grade"]) | |
print min-grade | |
return; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment