title: Python for loop accessing GPIO pins
body: <p>I'm new to Python and the Raspberry Pi. I'm trying to shorten my code and use <code>for</code> loops for repetitive parts in my code, like changing all pins to high and low. </p>
  
  <p>I'm trying to use a <code>for</code> loop to access pins. Is this even possible? </p>
  
  <pre><code>import RPi.GPIO as GPIO
  from time import sleep
  
  R1=22
  R2=10
  R3=9
  R4=11
  
  GPIO.setup(R1, GPIO.OUT)
  GPIO.setup(R2, GPIO.OUT)
  GPIO.setup(R3, GPIO.OUT)
  GPIO.setup(R4, GPIO.OUT)
  
  for x in range(1, 5):
      print "We're on time %d" % (x)
      GPIO.output(R + %d % (x), GPIO.HIGH)
      sleep(1)
      GPIO.output(R + %d % (x), GPIO.LOW)
      sleep(1)
  
  GPIO.cleanup()
  </code></pre>