[[Python]] https://docs.python.org/3/library/stdtypes.html#binary-sequence-types-bytes-bytearray-memoryview converting data into bytes: ```python data = [1,2,3,4,5] d = bytes(data) ``` Note that `bytes(5)` will not convert the integer 5 to bytes, it will return 5 empty bytes. ### find ```python d.find(3) ``` Result: `2` You can search for a byte sequence or an integer. This will return the lowest index where the subsequence is found. `rfind` is reverse find - it will start with the highest index instead You can also pass `find` an index to start and stop the search at ### partition ``` d.partition(bytes([3])) ``` Returns a 3-tuple containing: - the part of the sequence before the separator - the separator - the part of the sequence after the separator ### split Instead of just splitting at the first separator, this splits the entire sequence every time there is a separator, or splits it up to a number of types specified by `maxsplit`