User Tools

Site Tools


user:amalgamated_marks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
user:amalgamated_marks [2025/01/13 06:31] appledoguser:amalgamated_marks [2025/01/13 06:32] (current) appledog
Line 4: Line 4:
 <Code:Python> <Code:Python>
 t = [0 for _ in range(50)] t = [0 for _ in range(50)]
-    +
 # array of marks goes here # array of marks goes here
-a = [ +a = [ "1:6", "2:2", 5, 5, 5, -5, -15, 10 ]
-    "1:6", "2:2", 5, 5, 5, -5, -15, 10 +
-]+
  
 for m in a: for m in a:
     if ':' in str(m):     if ':' in str(m):
         m, p = m.split(':', 1)         m, p = m.split(':', 1)
-        m = int(m) +        t[int(m)] += int(p)
-        p = int(p) +
-        t[m] = t[m] + p+
     else:     else:
         if m > 0:         if m > 0:
-            t[m] = t[m] + 1+            t[m] = +1
         else:         else:
-            t[abs(m)] = t[abs(m)] - 1+            t[abs(m)] -1
  
 for x in range(50): for x in range(50):
     print (str(x) + ", " + str(t[x]))     print (str(x) + ", " + str(t[x]))
 </Code> </Code>
user/amalgamated_marks.1736749882.txt.gz · Last modified: by appledog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki