Professional Documents
Culture Documents
Concept: print(type()) = returns the data type of the python objects. Example: print(type(3.3)),
print(type(3)), print(type(“school”))
NOTE: For IDE’s other than azure, the type function must be coded differently than shown in the video. Include the
print function or it will not display.
Example: type(3.3) should be coded as: print(type(3.3)) # this will display: float
When using type, the result will display the data type of the information in the parenthesis:
str = when python detects a string of characters (numbers, letters, punctuation…. ) in quotes
int = when python detects an integer (positive or negative whole number)
float = when python detects decimal numbers (i.e: 3.1569, 0.0, 9.9999, 5.0)