Iterate over the tuple and increase a counter until you encounter an item of type tuple.
def count_until_tuple(t):
count = 0
for item in t:
if isinstance(item, tuple):
break
count += 1
return count
NOTEOwing to browser caching, any code input into the Trinket IDE might carry over across page refreshes or when transitioning between different questions. To commence with a clean slate, either click on the 'Reset Button' found within the IDE's Hamburger icon (☰) menu or resort to using Chrome's Incognito Mode.