title: How do I get the if-statement shorter?
body: <p>I want to connect between 1 and 4 lightbarriers to my RaspberryPi, but I do not know how to do the case differentiation in shorter lines (see below). Can someone tell me how to write the following code in a shorter way? Every case written below should do the same.</p>
  <pre><code>LIGHT_BARRIER_PIN_1 = 24 
  l2, l3, l4 = False, False, False 
  if config.value(&quot;rfu630.lightbarrier&quot;) &gt;= 2:
      l2 = True
      LIGHT_BARRIER_PIN_2 = 5
      if config.value(&quot;rfu630.lightbarrier&quot;) &gt;= 3:
          l3 = True
          LIGHT_BARRIER_PIN_3 = 6
          if config.value(&quot;rfu630.lightbarrier&quot;) &gt;= 4:
              l4 = True
              LIGHT_BARRIER_PIN_4 = 13
  
  while True:
      if l4 == True:
          if GPIO.input(LIGHT_BARRIER_PIN_1) == GPIO.HIGH or GPIO.input(LIGHT_BARRIER_PIN_2) == GPIO.HIGH or GPIO.input(LIGHT_BARRIER_PIN_3) == GPIO.HIGH or GPIO.input(LIGHT_BARRIER_PIN_4) == GPIO.HIGH:
              pass
      elif l3 == True:
          if GPIO.input(LIGHT_BARRIER_PIN_1) == GPIO.HIGH or GPIO.input(LIGHT_BARRIER_PIN_2) == GPIO.HIGH or GPIO.input(LIGHT_BARRIER_PIN_3) == GPIO.HIGH:
              pass
      elif l2 == True:
          if GPIO.input(LIGHT_BARRIER_PIN_1) == GPIO.HIGH or GPIO.input(LIGHT_BARRIER_PIN_2) == GPIO.HIGH:
              pass
      else:   
          if GPIO.input(LIGHT_BARRIER_PIN_1) == GPIO.HIGH:
              pass
  </code></pre>