I have a list of strings in my config file[fileconfig.cfg] :
fromtolist = ["from_currency=AUD&to_currency=USD","from_currency=CAD&to_currency=USD","from_currency=EUR&to_currency=USD"]
This is my code :
forex_api_key = parser.get('file_config','forex_api_key')forex_base_api_url = parser.get('file_config','forex_base_api_url')fromtolist = parser.get('file_config','fromtolist')for i in range(len(fromtolist)): print("inside forex loop") print(fromtolist[i]) endpoint_url = forex_base_api_url +'&'+ fromtolist[i]+'&'+'apikey='+forex_api_key print(endpoint_url)
loop is exiting since the variable endpoint_url is not getting the correct link, because i am not able to iterate over fromtolist[]