title: Except block not executing
body: <pre><code>import yfinance as yf
  import numpy as np
  import pandas as pd
  import matplotlib as ptl
  import investpy as invpy
  
  stock_data = invpy.stocks.get_stocks(&quot;Brazil&quot;)
  ticker_list = []
  for i in range(len(stock_data[&quot;symbol&quot;])):
      string_ticker = str(stock_data[&quot;symbol&quot;][i])
      ticker = f&quot;{string_ticker}.SA&quot;
      ticker_list.append(ticker)
  all_data = pd.DataFrame()
  
  for ticker in ticker_list:
      try:
          data = yf.download(ticker, period = &quot;max&quot;)
      except:
          ticker_list.remove(ticker)
  </code></pre>
  <p>I'm capturing all the tickers listed on the Brazilian stock exchange with investpy and because some symbols are delisted or give errors when running the finance.download function, I have to do a try and except block. But, for some reason, when the errors occur it doesn't delete the ticker that gave me the error. What I'm doing wrong and how can i make it work ?</p>