Hi@akhtar,
I don't know your use cases. But you may got this error when your tuple don't have any value. For an Example.
>>>x = ()
>>>y = x[0]
IndexError Traceback (most recent call last)
<ipython-input-3-5679abac6acb> in <module>
1 x = ()
----> 2 y = x[0]
IndexError: tuple index out of range
Here I am trying to assign an empty tuple to y. So I am getting this error. But You can avoid this error using if else condition.
if len(x)==0:
pass
else:
print('your code')
Hope this will help you.