title: How can I pass all the variables as a list and download multiple csv with few lines of code instead of several lines?
body: <p>I have around 50 stocks for which I need to pass the variable ticker1, ticker2, ticker3.....ticker50 in the URL. Currently, I wrote a repetitive 50 URLs where I pass Tickers from ticker1, ticker2...ticker50 seperately. How can I acheieve it without repeating the lines of code?</p>
  <p>So intead of having url1...url2....url50, I have one single url where it loops in all the tickers for ticker1-50 and it retrieves/downloads multiple csv in a given path.</p>
  <p>Below is my repetitive code which achieves the result but i want to optimize it and make it clutter free.</p>
  <pre><code>now = datetime.datetime.now()
   
  # Stk 1
  
      ticker1 = 'AAPL'
      period1Stk1 = int(time.mktime(now.replace(now.year - 1).timetuple()))
      period2Stk2 = int(time.mktime(datetime.datetime(2021, 12, 31, 23, 59).timetuple()))
      interval1 = '1d'
      url1 = f'https://query1.finance.yahoo.com/v7/finance/download/{ticker1}?period1={period1Stk1}&amp;period2={period2Stk2}&amp;interval={interval1}&amp;events=history&amp;includeAdjustedClose=true'
  
  # Stk 2
  ticker2 = 'ADBE'
  period1Stk1 = int(time.mktime(now.replace(now.year - 1).timetuple()))
  period2Stk2 = int(time.mktime(datetime.datetime(2021, 12, 31, 23, 59).timetuple()))
  interval1 = '1d'
  url2 = f'https://query1.finance.yahoo.com/v7/finance/download/{ticker2}?period1={period1Stk1}&amp;period2={period2Stk2}&amp;interval={interval1}&amp;events=history&amp;includeAdjustedClose=true'
  
  retrieve(url1,'/Users/stocks/Cypto/AAPL.csv')
  retrieve(url2,'/Users/stocks/ADBE.csv')
  </code></pre>
  <p>Thanks and appreciate your help!</p>