title: How to use for/while looping shapes in pygame to create a repeating pattern?
body: <p>For a school assignment, we must create a picture using pygame shapes and I have an issue with a for loop using offset. I am trying to draw the dividing broken yellow lines on a road. However, the issue is that the lines repeat vertically. There are stacked on top of each other. </p>
  
  <pre><code>import pygame
  pygame.init()
  white= [255,255,255]
  red =   [255,  0,  0] 
  size = [400,500]
  screen = pygame.display.set_mode(size) 
  done = False
  clock = pygame.time.Clock()
  
  while done == False:
     for event in pygame.event.get(): 
         if event.type == pygame.QUIT: 
             done = True
  
     screen.fill(white)
     for y_offset in range(100,0,-10):
         pygame.draw.line(screen,red,[10,+y_offset],[100,0+y_offset],5)
  
     pygame.display.flip()
  
  pygame.quit()
  </code></pre>
  
  <p>If you use this code, it prints 10 red horizontal lines on top of each other. I would like to know how I can make the lines repeat horizontally instead of vertically. I have no idea how to make them like this: - - -
  Can someone please help me with the looping process? I just don't understand the offsetting portion of it. Thanks!</p>