jithincheriyan:

filepath


Hi! Seems that your “filepath” variable is a tuple, and tuples dont have the “.endswith” function. Since string tuples usually look like this:
mytuple = ("apple", "banana", "cherry")
You can check every string of the tuple:
for string in mytuple:
   if string.endswith(’.h5’):
      #do something

It’s just an example of how to use endswith() on strings. Hope it helps you!