total = None
for i in range(2):
item_1 = b'\x01'
item_2 = b'\x02'
item_3 = b'\x03'
# concatenation
combined = item_1 + item_2 + item_3 # which makes b'\x01\x02\03'
total = total + combined # to make b'\x01\x02\03\x01\x02\03'
In the above, I get a error because I cannot concatenate None with Bytes. One way I am thinking is to give some value(let's say b'\x00') to total and remove in the total later, but not sure how to do it. Can someone please tell a away to achieve the above
total= b''instead of None