System and Python version

EasyOS Module Programs · 25 of 49

Write a Python program to get operating system and Python version information.

Advertisement
Output
Windows
3
True

Approach

  1. platform and sys modules.

Solution

Python
import platformimport sys print(platform.system())print(platform.python_version().split(".")[0])print(sys.version_info >= (3, 10))
Output
Windows
3
True

Learn the concept

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

More os module programs

← All 49 OS Module Programs

Leave a Comment