My iPhone is locked on iCloud and i need to find my iOS version? How i can do that please?

I have bought a locked iPhone 4s 16GB and i need to know what is it iOS version in order to unlock it.
Note that i have some simple skills on linux and cmd and python programming language.

You can't unlock your iPhone just by using your skills on linux and other programming knowledge that you mentioned. You will need more than that. And iCloud is particularly not very safe when it comes to privacy. Your alternate option regarding this will be Leo Privacy Guard.