The return value is from the ping command and will depend on whatever response is received by the command. This has nothing to do with Python programming but is a feature of the Windows ping command. If you run the following in a command window to check:
ping -n 1 192.168.0.9
echo %ERRORLEVEL%
The ERRORLEVEL variable give the result of the previous command.