what would be the fastest way to put the first 4 bytes of an 8 byte array in one array and the last 4 bytes in another one.
My approach was to create a for loop and then extract everything. Like this
for i in range(0,7):
if i < 4:
...
else
...
There has to be something more efficient. What am I missing?
byte array? and what do you optimise, number of lines, excetuion time, something else?forloop doesn't do anything with the last byte. You should type inrange(0,7)at a Python 2 command line (orlist(range(0,7))at a Python 3 command line) and see what you get.