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 229 views
2 answers 153 views
1 answer 98 views
3 answers 350 views
1 answer 327 views
1 answer 201 views
...