I built this simple little function to split a 6 character string into two segments, but why isn't it returning two 3-letter results? Ie, I would have thought:
FXPair[0:2] => 0, 1, 2 in terms of indexing?
def ISOCodes(FXPair):
ccy1 = FXPair[0:2]
ccy2 = FXPair[3:5]
return [ccy1, ccy2]
ISOCodes('USDCAD')
['US', 'CA']