diff options
Diffstat (limited to 'day1/exercise/duplicate_marks.py')
-rw-r--r-- | day1/exercise/duplicate_marks.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/day1/exercise/duplicate_marks.py b/day1/exercise/duplicate_marks.py index ce4cbca..8ad85d1 100644 --- a/day1/exercise/duplicate_marks.py +++ b/day1/exercise/duplicate_marks.py @@ -1,13 +1,18 @@ students = { - 'Madhu': 12, + 'Madhu': 45, 'Shantanu':45, 'Puneeth': 54, 'Vattam': 35, - 'KD': 50, + 'KD': 54, + 'Asokan': 45 } all_marks = students.values() unique_marks = set(all_marks) print "Number of Duplicate marks: ", len(all_marks) - len(unique_marks) -print "Duplicate marks: ", set(all_marks - list(unique_marks)) + +for i in unique_marks: + all_marks.remove(i) + +print "Duplicate marks:", set(all_marks) |