Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (19.9k points)

I am making a python program which would act as windows cmd, but I need a code which will display Windows's version.

1 Answer

0 votes
by (25.1k points)

You can use the getwindowsversion of the sys module in python:

 

 

import sys 

ver = sys.getwindowsversion()

print("{}.{}.{}".format(ver.major, ver.minor, ver.build))

Related questions

0 votes
1 answer
asked Jul 13, 2020 in Python by ashely (50.2k points)
0 votes
1 answer
0 votes
1 answer
0 votes
4 answers

Browse Categories

...