title: On PyCharm my left key and right key isn't responding
body: <pre><code>#enable pygame mode
  import pygame
  pygame.init()
  
  #create screen
  screen = pygame.display.set_mode((900,600))
  
  #Title + Logo
  pygame.display.set_caption("Space Invader")
  icon = pygame.image.load("chicken.png")
  pygame.display.set_icon(icon)
  
  #Player icon
  player_icon = pygame.image.load("spaceship.png")
  playerX = 400
  playerY = 500
  
  def player(x, y):
      screen.blit(player_icon, (x, y))
  
  #game loop
  running = True
  while running:
  
      # backround colour  RGB
      screen.fill((0, 0, 0))
  
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              running = False
              #If key pressed check wether its right or left
              if event.type == pygame.KEYDOWN:
                  if event.key == pygame.K_LEFT:
                      print("key left pressed")
                  if event.key == pygame.K_RIGHT:
                      print("key right pressed")
              if event.type == pygame.KEYUP:
                  if event.key == pygame.K_LEFT or event.key == pygame.K_RIGHT:
                      print("key stroke has benn released")
  
  
      #Player change in coordinates
      playerX += 0
      playerY += 0
  
      player(playerX, playerY)
      pygame.display.update()
  </code></pre>
  
  <p>I have been learning about pygame and game programing using python during this quarantine. I have been doing this by watching a tutorial on youtube. Please don't downgrade me I have tried harder to make my question better last time it was my first question and got 2 downgrades. Thankyou for your time.</p>