Byte order and encoding

Easysys Module Programs · 17 of 20

Write a Python program that prints the machine’s byte order and the default text encoding.

Advertisement
Output
little
utf-8

Approach

  1. sys.byteorder and sys.getdefaultencoding().

Solution

Python
import sys print(sys.byteorder)print(sys.getdefaultencoding())
Output
little
utf-8
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More sys module programs

← All 20 sys Module Programs