Having further google I have found this
hostname = input("Enter the ip address: ")
response = os.system("ping -c 1 " + str(hostname))
if response == 0:
print hostname, 'is up!'
print hostname, 'is down!
Will this perform the Ping?
Oh Yes it Will!!