list - For loop python invalid syntax -


i'm trying run loop in program calculate average of h need calculate value's of 2 arrays each element of arrays , add them up.

 htot = 0  in range (0, len(redshift)):  h = ((300000*redshift[i])/(np.power(10, (appmag[i]-19.0+5)/5))  htot = htot + h   hgem = htot/len(redshift)  print htot 

but invalid syntax error @ htot = htot + h

you forgot close parenthesis on previous line.

there many anyway, these enough:

h = 300000 * redshift[i]  / np.power(10, (appmag[i] - 19.0 + 5) / 5) 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -