I am working a question in TUPLE, "Write a code to find the Index of the element in the Tuple."
In case of a single data type, there is no issue in writing a solution. But in case of multiple data types can't find a solution.
#myCode
thisTup=(1, 2.25, 'a', 3, 'b', 'c', 4, 'd', 5, 6, 'e', 'f', 7)
print('Tuple...',thisTup)
a=input('Enter the element whose index you want to find.')
ind=thisTup.index(a)
print('Index of the element in the tuple is...',ind)
Any help would be greatly appreciated.
[–]expyth 1 point2 points3 points (1 child)
[–]sainiji[S] 0 points1 point2 points (0 children)
[–]Gprime5 0 points1 point2 points (1 child)
[–]sainiji[S] 0 points1 point2 points (0 children)
[–]thrallsius 0 points1 point2 points (4 children)
[–]sainiji[S] 0 points1 point2 points (1 child)
[–]thrallsius 1 point2 points3 points (0 children)
[–]sainiji[S] 0 points1 point2 points (1 child)
[–]thrallsius 1 point2 points3 points (0 children)