You can use ast.literal_eval() instead to parse the string returned by the input() function into an object represented by the content of the string, so that you can use isinstance() to test its type as you intended:
import ast
while True:
try:
valor = ast.literal_eval(input("Give me a number: "))
break
except SyntaxError, ValueError:
print("Please enter a valid number.")