Is the Windows version ever exposed as a string in the Windows API? Seems strange in my mind, but I have no experience with Windows. On the one hand it sounds like something Microsoft would do for backwards compatibility, but on the other hand it seems like a weird API to provide.
I found GetVersion[1] but that returns the version as two numbers.
You're imagining that all developers do things properly. I've seen Bash code that used a regex to get the first two digits from `python --version`. Hopefully they'll never release a Python 3.10!
I don't know if the rumor is true, but even if Windows itself doesn't provide an API that looks like that (I also looked around real quick and didn't find anything), it's not unreasonable that there could be libraries that provide the version that way.
The rumour is not true, despite reddit's insistence. Windows exposes it's version is a series of numbers, and even if it didn't, Windows 9 could have returned "Windows Nine", "Window v9" or loads of other things.
I found GetVersion[1] but that returns the version as two numbers.
[1] https://learn.microsoft.com/en-us/windows/win32/api/sysinfoa...