How to create bytes object with a string in Python

1 Answer

0 votes
b = bytes(b"abcdefg")
for ch in b:
    print(ch)


'''
run:

97
98
99
100
101
102
103

'''

 



answered Sep 6, 2018 by avibootz

Related questions

3 answers 201 views
201 views asked Sep 15, 2020 by avibootz
3 answers 218 views
1 answer 259 views
1 answer 169 views
1 answer 167 views
1 answer 181 views
...