How to define a byte string in python

"
o = bytes ("helloworld","utf-8")
r = o.center
print (r)

"

the second line of python code above reported an error. The error prompt is as follows:
r = o.center
TypeError: center () argument 2 must be a byte string of length 1, not str

The

error indicates that the second parameter of the center () method must be a byte string of length 1.
there is no great god until how to define a byte string in python.

Mar.24,2021

it's strange why you can't delete your own questions. So I had to answer my own questions. No, no, no.
o = bytes ('helloworld','utf-8')
fill = bytes (' -', 'utf-8')
r = o.center
print (r)

Menu