(a)Define the remove_triplets() function which is passed a listof integers as a parameter. The function removes all triplets fromthe list (i.e.,
removes any three elements in the list which are exactly the sameand are in sequence). For example, the following code:
a_list = [6, 6, 6, 7, 6, 6, 6, 3, 3, 3, 8, 8, 8, 3]
remove_triplets(a_list)
print(“1.”, a_list)
a_list = [6, 6, 6, 7, 6, 6, 6, 6, 6]
remove_triplets(a_list)
print(“2.”, a_list)
a_list = [6, 6, 6, 7, 6, 6, 4, 3, 3, 3, 8, 8, 8, 3]
remove_triplets(a_list)
print(“3.”, a_list)
a_list = [1, 1, 1, 4, 4, 4, 1, 1, 1]
remove_triplets(a_list)
print(“4.”, a_list)
a_list = [1, 1, 2, 1, 2,
PayPal Gateway not configured
PayPal Gateway not configured