1string = 'pythön!'
2
3print('The string is:', string)
4
5string_utf = string.encode("utf-8")
6
7print('The encoded version is:', string_utf)
8
9# Output:
10The string is: pythön!
11The encoded version is: b'pyth\xc3\xb6n!'
12
13# From: https://www.programiz.com/python-programming/methods/string/encode