Python Practice › OS Module Programs › Program 25
System and Python version
Write a Python program to get operating system and Python version information.
Output
Windows 3 True
Approach
platformandsysmodules.
Solution
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.