- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Check if two list of tuples are identical in Python
When it is required to check if two list of tuples are identical, the '==' operator is used.
The '==' operator checks to see if two iterables are equal or not.
A list can be used to store heterogeneous values (i.e data of any data type like integer, floating point, strings, and so on).
A list of tuple basically contains tuples enclosed in a list.
Below is a demonstration of the same −
my_list_1 = [(11, 14), (54, 58)] my_list_2 = [(98, 0), (10, 13)] print("The first list of tuple is : ") print(my_list_1) print("The second list of tuple is : ") print(my_list_2) my_result = my_list_1 == my_list_2 print("Are the list of tuples identical?") print(my_result)
The first list of tuple is : [(11, 14), (54, 58)] The second list of tuple is : [(98, 0), (10, 13)] Are the list of tuples identical? False
- Two list of tuples are defined, and are displayed on the console.
- The tuples are checked for being identical using the '==' operator.
- This is assigned to a value.
- It is displayed on the console.
- Check if two lists are identical in Python
- Check if tuple and list are identical in Python
- Python - Check if all elements in a list are identical
- Python Program to check if two given matrices are identical
- C# program to check if two matrices are identical
- Program to check if two given matrices are identical in C++
- Java program to check if two given matrices are identical
- Python program to check whether two lists are circularly identical
- Remove tuples from list of tuples if greater than n in Python
- Combining tuples in list of tuples in Python
- Count tuples occurrence in list of tuples in Python
- Check if two List objects are equal in C#
- Check if element is present in tuple of tuples in Python
- Remove duplicate tuples from list of tuples in Python
- Convert list of tuples into list in Python