Write a Python program to get the frequency of the elements in a given list of lists. Use collections module
- برمجة
- برمجة بايثون
- 2021-04-16
- salsabeelalhams99111801528
الأجوبة
from collections import Counter
from itertools import chain
nums = [
[1,2,3,2],
[4,5,6,2],
[7,1,9,5],
]
print("Original list of lists:")
print(nums)
print("\nFrequency of the elements in the said list of lists:")
result = Counter(chain.from_iterable(nums))
print(result)أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال