day1/exercise/duplicate_marks.py
author Nishanth Amuluru <nishanth@fossee.in>
Tue, 14 Dec 2010 23:15:36 +0530
branchscipyin2010
changeset 456 a27ccfc118fb
parent 386 a0bec380b44f
permissions -rw-r--r--
removed sslc1.txt from circulate since it is not required
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
64
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     1
students = {
386
a0bec380b44f Major edits.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 64
diff changeset
     2
    'Madhu': 45,
64
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     3
    'Shantanu':45,
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     4
    'Puneeth': 54,
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     5
    'Vattam': 35,
386
a0bec380b44f Major edits.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 64
diff changeset
     6
    'KD': 54,
a0bec380b44f Major edits.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 64
diff changeset
     7
    'Asokan': 45
64
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     8
    }
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     9
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    10
all_marks = students.values()
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    11
unique_marks = set(all_marks)
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    12
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    13
print "Number of Duplicate marks: ", len(all_marks) - len(unique_marks)
386
a0bec380b44f Major edits.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 64
diff changeset
    14
a0bec380b44f Major edits.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 64
diff changeset
    15
for i in unique_marks:
a0bec380b44f Major edits.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 64
diff changeset
    16
    all_marks.remove(i)
a0bec380b44f Major edits.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 64
diff changeset
    17
a0bec380b44f Major edits.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 64
diff changeset
    18
print "Duplicate marks:", set(all_marks)