-1

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

Hint

How to make it?

UltraStudioLTD
  • 300
  • 2
  • 14

3 Answers3

1
import platform
platform.version()

My output was '10.0.17134'

Kyle
  • 49
  • 9
1
import sys

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

Output : 10.0.18362

Wura
  • 147
  • 1
  • 10
0

You can try this:

import os
os.system('ver')
Paolo Mossini
  • 1,064
  • 2
  • 15
  • 23