day1/exercise/duplicate_marks.py
author Santosh G. Vattam <vattam.santosh@gmail.com>
Mon, 22 Feb 2010 14:32:01 +0530
changeset 373 f04eca8b2f3d
parent 64 333092b68926
child 386 a0bec380b44f
permissions -rw-r--r--
Commits from NIT DGP and IITK

students = {
    'Madhu': 12,
    'Shantanu':45,
    'Puneeth': 54,
    'Vattam': 35,
    'KD': 50,
    }

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))