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

1 Answer

0 votes
b = bytes(b"python php pascal")

part = b[0:3]

for element in part:
    print(element)


'''
run:

112
121
116

'''

 



answered Sep 6, 2018 by avibootz

Related questions

2 answers 180 views
2 answers 105 views
3 answers 219 views
1 answer 259 views
1 answer 169 views
...