Checking Types using
We have seen that data in Python can be classified as belonging to a specific type, e.g.
1is an integer.
5.2123is a floating-point number.
"Tuesday"is a string.
We can check the type of a data value using the
This also works for
And even for functions:
Numeric data types¶
integers and floating-point numbers are both examples of numeric data types. Python also has a built in complex data type that can be used for working with complex numbers. Complex numbers in python are written using
j to denote the imaginary component:
5 + 3j
type(5 + 3j)