Answer the question
In order to leave comments, you need to log in
Error name error name is not defined, what should I do?
Here is the complete error:
File "game.py", line 5, in
pygame.display.set_caption(game)
NameError: name 'game' is not defined
import pygame
pygame.init()
win = pygame.display.set_mode((500, 500))
pygame.display.set_caption(game)
run = True
while(True):
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit()
Answer the question
In order to leave comments, you need to log in
You need to write the name of your game in brackets in the line pygame.display.set_caption
Start by reading the documentation:
1. Documentation for the resource where you post the question. You broke a whole bunch of rules at once.
2. Documentation for the language in which you write the program.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question