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

1 answer 98 views
3 answers 261 views
261 views asked Sep 15, 2020 by avibootz
3 answers 350 views
1 answer 327 views
1 answer 201 views
1 answer 201 views
1 answer 223 views
...