title: How to handle unreachable code in Python in for loop
body: <p>I am trying to check an ascending or descending trend in a list. If the trend is ascending I want it to print "Buy" else print "Sell".</p>
  
  <p>This is for a python program for trend analysis.
  PS- I am new to coding</p>
  
  <pre><code>adi = ta.acc_dist_index(high, low, close, volume, fillna=False)
  a = adi[-1]
  
  ADI = adi[-7:]
  vol_status_adi = ""
  
  if a &lt;=100:
  def order():  # For ascending
      for i in range(len(ADI) - 1):
          if ADI[i] - ADI[i + 1] &gt; 0:
              return False
          return True
  
  if True:
      vol_status_adi = "Buy"
  else:
      vol_status_adi = "Sell" --- unreachable code
  print("ADI signal is: ", vol_status_adi)
  </code></pre>
  
  <p>expected output '''ADI signal is: But/Sell'''</p>
  
  <p>actual output ''' ADI signal is: '''</p>