print(type(x))
v = 10 type(v) # <type 'int'>
>>>foo = "Hello, World!" >>>isinstance(foo, str) # isinstance(<input>, <type>) True >>>isinstance(foo, int) False
str = "Hello" type(str)
## To get the type of a variable, use 'type()' type("Hello World!") ## Output: ## str
isinstance(object, classinfo) The isinstance() takes two parameters: object : object to be checked classinfo : class, type, or tuple of classes and types