-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5c681d
commit 3887582
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
alice =int(input("enter mark of alice:")) | ||
jack=int(input("enter mark of jack: ")) | ||
sid=int(input("enter mark of sid: ")) | ||
student_score=({"alice":alice, "jack":jack,"sid":sid}) | ||
def average(i): | ||
total=sum(i.values()) | ||
count=len(i) | ||
avg=total/count | ||
return avg | ||
print("Average score:",average(student_score)) | ||
def find_highest_score(scores): | ||
highest_student= None | ||
highest_score=0 | ||
for student,score in scores.items(): | ||
if score> highest_score: | ||
highest_score=score | ||
highest_student=student | ||
return highest_student,highest_score | ||
highest_student,highest_score=find_highest_score(student_score) | ||
print(f"Highest score:{highest_student} with {highest_score}") | ||
|