How to create a bytes or bytearray of given length filled with zeros in Python? March 7, 2023 by Tarik This will give you 100 zero bytes: bytearray(100) Or filling the array with non zero values: bytearray([1] * 100)