title: Local variable 'put' might be referenced before assignment
body: <p>When I execute this code I'm not getting output and it says local variable might be referenced before assignment. I don't know what it is exactly.</p>
  
  <pre><code>def funct():
      try:
          no = 2
          put = []
          if no == 1:
              out = 'yes'
              put.append(out)
          elif no == 2:
              out = 'no'
              put.append(out)
          elif no == 3:
              out = 'cant predict'
              put.append(out)
      except ValueError:
          print("Something is wrong")
      else:
          print("Everything is ok")
  
      put = str(put)[1:-1]
      print(put)
      return put
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/TTQ6K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TTQ6K.png" alt="Screenshot of warning message from PyCharm"></a></p>