I wrote a simple function to retrieve three outputs from a string. When I want to use the returned value in other functions the order changes. For example:
def parsetrack2(trackstr):
cardnumber, date = trackstr.split('=')
expiryyear = date[0:2]
expirymonth = date[2:4]
return{cardnumber,expiryyear,expirymonth}
When I want to pass the cardnumber
and expiryyear
to another function, sometimes order changes and other times it is right? Why is that?
How should I change it to prevent that variation?