If a Python string variable has had either an integer, floating point number or a non-numeric string placed in it, is there a way to easily test the "type" of that value?
The code below is real (and correct of course):
>>> strVar = "145"
>>> print type(strVar)
<type 'str'>
>>>
but is there a Python function or other method that will enable me to return 'int' from interrogating strVar set as above
Perhaps something like the nonsense code and results below ...
>>> print typeofvalue(strVar)
<type 'int'>
or more nonsense:
>>> print type(unquote(strVar))
<type 'int'>
var = "Hello 20""contain a number"?