type ()
methodThe type ()
method returns the type of value or variable specified in the argument as an argument. Type using this method
To check the identity, use ʻis` as follows.
a = type('Hello, World') is str
b = type('Hello, World') is int
c = type('Hello, World') is not str
Execution result
True False False
Recommended Posts