Answer the question
In order to leave comments, you need to log in
How to combine 2 loops and will it optimize the program?
There is a piece of code with loops:
inter_mass_n = {item : 0 for i in mass_q for item in range(i[0]-1, i[1])}
for i in mass_q:
for j in range(i[0]-1, i[1]):
inter_mass_n[j] += 1
Answer the question
In order to leave comments, you need to log in
De facto, the program does not know what. for example
inter_mass_n = {item : 0 for i in mass_q for item in range(i[0]-1, i[1])}
for i in mass_q:
for j in range(i[0]-1, i[1]):
inter_mass_n[j] += 1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question