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 Matix
- Python | Check if one list is subset of other
- Python | Check if list is sorted or not
- Python | Check if all elements in a List are same
- Python | Check if all the values in a list are less than a given value
- Python | Check whether a list is empty or not
- Python | Check if list contains consecutive numbers
- Python | Check if all the values in a list that are greater than a given value
- Python | Check if given words appear together in a list of sentence
- Python | Check if two list of tuples are identical
- Python | Check if list is strictly increasing
- Python | Check for Nth index existence in list
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.