Answers for "encode python"

6

utf8 python encodage line

# -*- coding: utf-8 -*-
Posted by: Guest on December-04-2020
1

.encode python

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'pyth\xc3\xb6n!'

# From: https://www.programiz.com/python-programming/methods/string/encode
Posted by: Guest on March-01-2021

Python Answers by Framework

Browse Popular Code Answers by Language