python: processing a 16-element list into an 8-element list -


I have a list of 16 elements [a00, a01, a02, ..., a15] and a list [b0] , B1, b2, b3, b4, b5, b6, b7] where

  b0 = a00 * 256 + a01 b1 = a02 * 256 + a03 b2 = a04 * 256 + a05 (etc.)  

What is the easiest way to do this? (I'm starting in Python)

You can create an understanding list ...

  a = [a00, a01, ....] #Raid, 0,2,4 ... LAN (A) [will be closed at 15, 14] ## [I] * 256 + one [I + 1], then # one [0] * 256 + one [1], one [2] * 256 + one [3], ... a [14] * 256 + A [15] b = [a [i] * 256 + a [i + 1] i in category (0, lane (a), 2)]  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -