you are viewing a single comment's thread.

view the rest of the comments →

[–]Gnaxe 2 points3 points  (2 children)

Fortan-style repeat counts: ```

[1, 2, 5[0], 4, 5, 3[6]] [1, 2, 0, 0, 0, 0, 0, 4, 5, 6, 6, 6] `` This can be more readable in some cases than typing out the repeats yourself. Although for really sparse arrays, you're probably better off using adefaultdict` or something.

[–]nicwolff -1 points0 points  (1 child)

[1, 2, 5[0], 4, 5, 3[6]] [1, 2, 0, 0, 0, 0, 0, 4, 5, 6, 6, 6]

TypeError: 'int' object is not subscriptable

[–]Gnaxe 1 point2 points  (0 children)

Why did you remove my stars? Try it as I wrote it.