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
- How to create a list of object in Python class
- Python | Check if a list exists in given list of lists
- Python | Check if a list is contained in another list
- Python | Check if list is sorted or not
- Python | Check if all the values in a list are less than a given value
- Python | Check if list is Matix
- Python | Check whether a list is empty or not
- Python | Check if one list is subset of other
- Python | Check if all elements in a List are same
- Python | Check if all elements in a list are identical
- Python | Check for Nth index existence in list
- Python | Check if given words appear together in a list of sentence
- Python | Check if list contains consecutive numbers
- Python | Check if list contains all unique elements
- Python | Check if all the values in a list that are greater than a given value
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.