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 106 views
3 answers 269 views
269 views asked Sep 15, 2020 by avibootz
3 answers 370 views
1 answer 331 views
1 answer 206 views
1 answer 206 views
1 answer 229 views
...