Created
July 9, 2020 07:24
-
-
Save BexTuychiev/f11d15bbd1d30e13b1e9f8068c3ab35b to your computer and use it in GitHub Desktop.
Type checking for the basic built-in objects in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable = 'Python' | |
if type(variable) in [set, int, str, dict, list, float, tuple, bool]: | |
print('It is a built-in type') | |
else: | |
print('Maybe not a built-in?') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment