How to get a slice (a part) from bytearray object with a string in Python

1 Answer

0 votes
b = bytearray(b"python php c++")

part = b[0:4]

for element in part:
    print(element)


'''
run:

112
121
116
104

'''

 



answered Sep 6, 2018 by avibootz

Related questions

1 answer 242 views
2 answers 180 views
1 answer 255 views
1 answer 141 views
...