Finding the ending letter in a string

I have the following code snipit that I am trying to determine which tanks end with the letter ‘T’ and put them into the list transferList. I get an error on the line “if tank.endswith(‘T’)”. I give up. What am I doing wrong this time?

dsList = fpmi.db.toPyDataSet(event.source.parent.getComponent('MyCalendar').dsNextWeek)

tankList = dsList[0][myDay]
tankList = string.split(tankList,",")

for tank in tankList:
   if tank.endswith('T')
      transferList = transferList + tank

Sorry for my blunder. I just noticed that I left off the : after the “if” statement. :blush:

FYI, there is an alternative to the string.endswith() method. You could use Jython/Python string slicing as in the following:

if tank[-1] == 'T':