You are looking for the set intersection of all the sublists, and the data type you should use for set operations is a set:
result = set(p[0])
for s in p[1:]:
result.intersection_update(s)
print result
More Related Contents:
- How to efficiently compare two unordered lists (not sets) in Python?
- Python recursion with list returns None [duplicate]
- Basics of recursion in Python
- How to do a recursive sub-folder search and return files in a list?
- How to efficiently compare two unordered lists (not sets)?
- Check if two unordered lists are equal [duplicate]
- Confusing […] List in Python: What is it?
- Generate all possible lists of length N that sum to S in Python
- Flattening a list recursively [duplicate]
- Python recursive function to display all subsets of given set
- How do I reverse a list using recursion in Python?
- Given a list of elements in lexicographical order (i.e. [‘a’, ‘b’, ‘c’, ‘d’]), find the nth permutation – Average time to solve?
- What does += mean in this context?
- What does “list comprehension” and similar mean? How does it work and how can I use it?
- Why does append() always return None in Python? [duplicate]
- Recursive function returning none in Python [duplicate]
- Convert all strings in a list to int
- Get unique values from a list in python [duplicate]
- Element-wise addition of 2 lists?
- Sum a list of numbers in Python
- List comprehension vs generator expression’s weird timeit results?
- Modify a list while iterating
- How to flatten a nested JSON recursively, with flatten_json
- How do I loop through a list by twos? [duplicate]
- How to make a set of lists
- Create random list of integers in Python
- Why does df.apply(tuple) work but not df.apply(list)?
- double equals vs is in python [duplicate]
- Creating a dictionary with list of lists in Python
- Check list monotonicity