string = 'pythön!'
print('The string is:', string)
string_utf = string.encode("utf-8")
print('The encoded version is:', string_utf)
# Output:
The string is: pythön!
The encoded version is: b'pythxc3xb6n!'
# From: https://www.programiz.com/python-programming/methods/string/encode
original = "original string"
encoded = original.encode()
Output:b'original string'