The capabilities property is a dictionary containing information about the browser, so if you are using Chrome then this should work:
print driver.capabilities['version']
And if you are using Firefox, the following should work:
driver.capabilities['browserVersion']
If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s Selenium training!