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

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -