
November 8th, 2012, 07:31 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 2
Time spent in forums: 22 m 22 sec
Reputation Power: 0
|
|
|
Complete newbie question about searching dictionaries
Hi, I started using python 2.7 last week, so am (as yet) utterly hopeless. I'm trying to define a function to search a dictionary of exam results, and return an answer for who got a result above 70. Could anyone possibly help me with my code? Thanks!
marks={"John":45,"Suzy":46,"Edward":75,"Mike":66}
def who_got_above_seventy(x):
for p in x:
if p>=70:
print p
Thanks! 
|