Python Practice › sys Module Programs › Program 17
Byte order and encoding
Write a Python program that prints the machine’s byte order and the default text encoding.
Output
little utf-8
Approach
sys.byteorderandsys.getdefaultencoding().
Solution
import sys print(sys.byteorder)print(sys.getdefaultencoding())Output
little utf-8
Learn the concept
New to this topic? Read the lesson, then come back.