Why isnt this working (pygame)

my code:

import pygame, sys
from pygame.locals import QUIT
from pygame.locals import *

pygame.init()
WIDTH, HEIGHT = 360, 540
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Space Dodge")

BACKGROUND = pygame.transform.scale(pygame.image.load("hello.png"), (WIDTH, HEIGHT))

PLAYER_HEIGHT = 40
PLAYER_WIDTH = 20
player_starting_y = HEIGHT - PLAYER_HEIGHT
player_starting_x = HEIGHT / 2
red = (255, 0, 0)
white = (255, 255, 255)


def draw(player):
  screen.blit(BACKGROUND, (0, 0))
  pygame.draw.rect(screen, red, player)
  pygame.draw.rect(screen, white, right_button)
  pygame.draw.rect(screen, white, left_button)

  pygame.display.update()


right_button = pygame.Rect(70, 480, 50, 50)
left_button = pygame.Rect(10, 480, 50, 50)

pygame.mouse.set_visible(False)


def main():
  running = True
  pygame.mouse.set_visible(False)

  player = pygame.Rect(
    player_starting_x, player_starting_y, PLAYER_WIDTH, PLAYER_HEIGHT
  )

  while running:
    for event in pygame.event.get():
      if event.type == QUIT:
        pygame.quit()
        sys.exit()
    pygame.display.update()
    draw(player)

Hi @FinnifyYT !
Can you format your code with code fences ``` ?

@FinnifyYT Additionally, could you elaborate when you said that it’s not working? Are there any error messages? Does the file not run?

There are several issues.

Identation is wrong in draw function.
You are using curly quotes instead of straight quotes.
You’re calling pygame.display.update() twice (redundant).

But as @NateDhaliwal said, format your answer using the triple quotes ``` (you can either do this or select the text of your code and use ctrl+e) and give us the error message that the console provides for you.

There are no errors or issues in your code, except a duplicate pygame.display.update().
However, you forgot to run main() at the end of the file. :exploding_head: