micropython/tests/basics/bytearray_construct.py

7 lines
153 B
Python

# test construction of bytearray from different objects
# bytes, tuple, list
print(bytearray(b'123'))
print(bytearray((1, 2)))
print(bytearray([1, 2]))