Python type function is used to get the type of object. This function with one argument, return the type of an object. The type() function is mostly developers use it for debugging purposes.
type(object, bases, dict)
Note: The isinstance() function is recommended for check the type of an object because it takes subclasses into account.
Example type function in Python
Simple example code.
a = ('a', 'b', 'v') b = "Hello World" c = 100 print(type(a)) print(type(b)) print(type(c))
Do comment if you have any doubts and suggestions on this Python basic function tutorial.
Note: IDE: PyCharm 2021.1.3 (Community Edition)
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.
Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.