python - How do I make this snippet Pythonic? -
i want know how python programmers write following snippet:
for in range(10): indexvector[i] = empavg[i] + upperbound(t, pullcount[i])
here t
constant. can see, used c/c++ style code want use python right way.
if want use list comprehension create indexvector
(assuming not have other value outside 10 indexes entered in snippet) , can use -
indexvector = [empavg[i] + upperbound(t, pullcount[i]) in range(10)]
Comments
Post a Comment