title: Is there a way of toggling elements in a python list?
body: <p>I'm new in programming, and am finding a way (if any) to toggle the elements in a list.</p>
  <p>I have a list where the elements can be either 1 or 0. I want to toggle them went I give a particular input.<br />
  I tried the following way:</p>
  <pre class="lang-py prettyprint-override"><code>i = input('Enter something: ')
  check_var_list = ['1', '1', '0']
  if i == 'Particular input':
      for element in check_var_list:
          if int(element) == 0:
              element = 1
          elif int(element) == 1:
              element = 0
  </code></pre>
  <p>But printing this is just print a copy of the original list.</p>
  <p>How do I toggle them? Is there a function for that?<br />
  I am on Python 3.8.</p>