0
I am solving an exercise that I first have to test whether the argument received is a Double. If yes, I have to test if all its elements are tuples of 2 elements, where the first is a string, and the second is an integer.
I know that to test whether it is Thiuplo is used:
isinstance(t[i], tuple)
To test if 1st element is string:
isinstance(t[0], str)
To test if the 2nd element is integer:
isinstance(t[1], int)
My question is: how do I test whether all the elements of Tuplo are 2-element tuples?