# Write a Python program to Maximum and Minimum K elements in Tuple # Python3 code to demonstrate working of# Maximum and Minimum K elements in Tuple# Using sorted() + loop# initializing tupletest_tup = (5, 20, 3, 7, 6, 8)# printing original tupleprint("The original tuple is : " + str(test_tup))# initializing KK = 2# Maximum and Minimum K elements in Tuple# Using sorted() + loopres = []test_tup = list(sorted(test_tup))for idx, val in enumerate(test_tup):    if idx < K or idx >= len(test_tup) - K:        res.append(val)res = tuple(res)# printing resultprint("The extracted values : " + str(res))