Skip to content

Instantly share code, notes, and snippets.

@AhmedZahid098
Created May 15, 2018 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AhmedZahid098/0ca0ae80dec60df834e1216acbb93f5d to your computer and use it in GitHub Desktop.
Save AhmedZahid098/0ca0ae80dec60df834e1216acbb93f5d to your computer and use it in GitHub Desktop.
# There are three ways to tests type in python
L = [None]
# using type syntx
if type(L) == type([]):
print('yup')
# using type name
if type(L) == list:
print('yup')
# using object orient test
if isinstance(L, list):
print('yup')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment