# Write a Python program to Assign Frequency to Tuples # Python3 code to demonstrate working of # Assign Frequency to Tuples# Using Counter() + items() + * operator + list comprehensionfrom collections import Counter  # initializing listtest_list = [(6, 5, 8), (2, 7), (6, 5, 8), (6, 5, 8), (9, ), (2, 7)]  # printing original listprint("The original list is : " + str(test_list))  # one-liner to solve problem# assign Frequency as last element of tupleres = [(*key, val) for key, val in Counter(test_list).items()]  # printing resultsprint("Frequency Tuple list : " + str(res))