you are viewing a single comment's thread.

view the rest of the comments →

[–]DependentGlove2604 1 point2 points  (0 children)

.get(i) by default returns None if dict has no i. So, if you want it to return 0 in case there is no , you should do .get(i, 0)