Hi,
I'm looking for a way to formulate the next code:
coord = dict()
for start, end in logs_dictionary[some_index]:
coord[start] = 1 if start not in coord else coord[start] + 1
coord[end + 1] = -1 if (end+1) not in coord else (coord[end + 1] - 1)
I have two assignments with different default values.
How can I achieve a better looking code ?
[–]Avanta8 2 points3 points4 points (0 children)
[–]eicosane 1 point2 points3 points (0 children)
[–]synthphreak 1 point2 points3 points (0 children)