Given an object, the task is to check whether the object is list or not.
Method #1: Using isinstance
your object is a list ! your object is not a list
Method #2: Using
your object is a list your object is not a list
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Object Oriented Programming in Python | Set 1 (Class, Object and Members)
- Object Oriented Programming in Python | Set 2 (Data Hiding and Object Printing)
- Python - Check whether the given List forms Contiguous Distinct Sub-Array or Not
- Python | Check if a list exists in given list of lists
- Python - Check if a list is empty or not
- Python | Check if list is sorted or not
- Python | Convert list of string to list of list
- Python | Convert list of tuples to list of list
- Python | Convert List of String List to String List
- How to create a list of object in Python class
- Python - List object in Tweepy
- Python | Check if a nested list is a subset of another nested list
- Python | Check if a list is contained in another list
- Python - Check List elements from Dictionary List
- Python Set | Check whether a given string is Heterogram or not
- Python | Check if a given string is binary string or not
- Python program to check if a given string is Keyword or not
- Python | Check if given string is numeric or not
- Python Membership and Identity Operators | in, not in, is, is not
- Python | Filter a list based on the given list of strings
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.