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

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

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

html - jQuery UI Sortable - Remove placeholder after item is dropped -