So I just finished up with a good amount of learning python and working on learning pygame. So I am following along with this free online book, and the first thing of code in the book of making a window with hello world on the top is giving me an error:
Heres the code:
import pygame, sys
from pygame.locals import *
pygame.init()
DISPLAYSURF = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Hello World!')
while True: # main game loop
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
pygame.display.update()
Heres the error:
File "pygame.py", line 9
if event.type == QUIT:
^
IndentationError: expected an indented block
Thanks in advance!