# Write a Python program to Elements Frequency in Mixed Nested Tuple # Python3 code to demonstrate working of # Elements Frequency in Mixed Nested Tuple# Using recursion + loop  # helper_fncdef flatten(test_tuple):    for tup in test_tuple:        if isinstance(tup, tuple):            yield from flatten(tup)        else:            yield tup  # initializing tupletest_tuple = (5, 6, (5, 6), 7, (8, 9), 9)  # printing original tupleprint("The original tuple : " + str(test_tuple))  # Elements Frequency in Mixed Nested Tuple# Using recursion + loopres = {}for ele in flatten(test_tuple):    if ele not in res:        res[ele] = 0    res[ele] += 1  # printing result print("The elements frequency : " + str(res))