Contact: aviboots(AT)netvision.net.il
38,907 questions
50,613 answers
573 users
bytes_object = bytes(b"abcd") print(type(bytes_object)) print(bytes_object) for item in bytes_object: print(item) ''' run: <class 'bytes'> b'abcd' 97 98 99 100 '''
bytes_object = b'\x65\x66\x67' print(type(bytes_object)) print(bytes_object) for item in bytes_object: print(item) ''' run: <class 'bytes'> b'efg' 101 102 103 '''
bytes_object = 'python'.encode('utf-8') print(type(bytes_object)) print(bytes_object) for item in bytes_object: print(item) ''' run: <class 'bytes'> b'python' 112 121 116 104 111 110 '''