user:amalgamated_marks
This is an old revision of the document!
Amalgamated Marks
Python Program
t = [0 for _ in range(50)]
# array of marks goes here
a = [ "1:6", "2:2", 5, 5, 5, -5, -15, 10]
for m in a:
if ':' in str(m):
m, p = m.split(':', 1)
t[int(m)] += int(p)
else:
if m > 0:
t[m] = += 1
else:
t[abs(m)] -= 1
for x in range(50):
print (str(x) + ", " + str(t[x]))
user/amalgamated_marks.1736749960.txt.gz · Last modified: by appledog
