title: I want my player (image) to move left and right
body: <p>I'm new to programing and I need help to move my player (image) to left and right (hopefully with keybindings)</p>
  <p>I really don't know what I'm doing and I just need help, please help</p>
  <p>Here's my code so far:</p>
  <pre><code>
  import pygame
  
  # Intialize the pygame
  pygame.init()
  
  # Resulution?
  screen = pygame.display.set_mode((800, 600))
  
  # Title and Logo
  pygame.display.set_caption(&quot;Båtisens Herre&quot;)
  icon = pygame.image.load('img.png')
  pygame.display.set_icon(icon)
  
  #Background
  background = pygame.image.load(&quot;bakgrunn.png&quot;)
  
  # Player
  playerImg = pygame.image.load('King Arthur2.png')
  playerX = 100
  playerY = 200
  
  def player(x, y):
      screen.blit(playerImg, (x, y))
  
  #game loop 
  
  running = True
  while running:
  
      # RGB (red, green blue)
      screen.fill((248, 58, 226))
      playerY -=0
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              running = False
  
  #Background(2)
      screen.blit(background, (0, 0,))
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              running = False
  
      player(playerX, playerY)
      pygame.display.update()
  
  </code></pre>