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 189 views
3 answers 413 views
413 views asked Sep 15, 2020 by avibootz
3 answers 550 views
1 answer 412 views
1 answer 295 views
1 answer 293 views
1 answer 317 views
...