title: SyntaxWarning: name 'item' is assigned to before global declaration global item
body: <p>I am very new to python and am trying to make a basic shopping list program as a starting project.</p>
  
  <p>The error I get on running is :</p>
  
  <p>C:\Users\User\PycharmProjects\untitled\venv\Scripts\python.exe C:/Users/User/.PyCharmCE2018.1/config/scratches/scratch_3.py
  Please enter item number 1: C:/Users/User/.PyCharmCE2018.1/config/scratches/scratch_3.py:29: SyntaxWarning: name 'item' is assigned to before global declaration
    global item</p>
  
  <p>Can someone please explain why I am getting this issue and/or a better way to achieve the same result?</p>
  
  <pre><code>num = 1
  item = input('Please enter item number ' + str(num) + ': ')
  my_list = [item]
  del_list = []
  
  def _delete_ ():
      global my_list
      global del_list
      global num
      global item
      if item == 'DELETE':
          delitem = my_list.pop()
          del_list.append(delitem)
          print('You have successfully deleted ' + delitem + ' from your shopping list')
          num = num - 1
  
  def _add_to_list_():
      global item
      global my_list
      global num
      item = input('Please enter item number ' + str(num) + ': ')
      my_list.append(item)
      num = num + 1
      print(my_list)
  
  
  while item != 'STOP':
      global item
      if item == 'DELETE':
          _delete_()
      else:
          _add_to_list_()
  </code></pre>