I want to check the type of input on the screen by using
python types
module
I have used the type(2) is int
for integer. ---->>>working
I have used the type("Vivek") is str
for string. ---->>>working
but i am confused when I take input using raw_input()
import types
p = raw_input("Enter input ")
if I entered string like "vivek" on console
then it is ok
the matter is when int
and float
entered
so what will be the canonical way to checked whether an input is of boolean
,int
,char,string
,long
,byte
,double
in python
.