bytes data type represens a group of byte numbers just like an array. 1) x = [10,20,30,40] 2) b = bytes(x) 3) type(b) bytes 4) print(b[0]) 10 5) print(b[-1]) 40 6) >>> for i in b : print(i) 7) 8) 10 9) 20 10) 30 11) 40 Conclusion 1: The only allowed values for byte data type are 0 to 256. By mistake if we are trying to provide any other values then we will get value error.
Conclusion 2: Once we creates bytes data type value, we cannot change its values,otherwise we will get TypeError.