Write a function commonElements(t1, t2) that takes in 2 tuples as arguments and returns a sorted tuple containing elements that are found in both tuples.
Examples
>>> commonElements((1, 2, 3), (2, 5, 1))
(1, 2)
>>> commonElements((1, 2, 3, 'p', 'n'), (2, 5 ,1, 'p'))
(1, 2, 'p')
>>> commonElements((1, 3, 'p', 'n'), ('a', 2 , 5, 1, 'p'))
(1, 'p')
i want to compare between two tuples
def commonElements(t1,t2):
if t1 in t2:
return t1