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 283 views
2 answers 236 views
1 answer 322 views
1 answer 195 views
...