Skip to content

Instantly share code, notes, and snippets.

@BexTuychiev
Created July 9, 2020 07:24
Show Gist options
  • Save BexTuychiev/f11d15bbd1d30e13b1e9f8068c3ab35b to your computer and use it in GitHub Desktop.
Save BexTuychiev/f11d15bbd1d30e13b1e9f8068c3ab35b to your computer and use it in GitHub Desktop.
Type checking for the basic built-in objects in Python
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