while True: for symbol in symbols: base, counter = symbol.split('_')[0], symbol.split('_')[1] tickers = requests.get(last_price.format(base, counter)) time.sleep(5)