Skip to main content
Format, fixed caps.
Source Link
Vaillancourt
  • 16.4k
  • 17
  • 56
  • 61

CORRECT CODE WILL BE LIKE BELOW:

from pygame.locals import *

import sys,pygame

screen=pygame.display.set_mode((200, 100))

pygame.display.set_caption("hello")

while(True):

for event in pygame.event.get()This is the correct code:

from pygame.locals import *

import sys,pygame

screen=pygame.display.set_mode((200, 100))

pygame.display.set_caption("hello")

while(True):

   for event in pygame.event.get():

        if event.type==QUIT:

            pygame.quit()

            sys.exit()

CORRECT CODE WILL BE LIKE BELOW:

from pygame.locals import *

import sys,pygame

screen=pygame.display.set_mode((200, 100))

pygame.display.set_caption("hello")

while(True):

for event in pygame.event.get():

    if event.type==QUIT:

        pygame.quit()

        sys.exit()

This is the correct code:

from pygame.locals import *

import sys,pygame

screen=pygame.display.set_mode((200, 100))

pygame.display.set_caption("hello")

while(True):

   for event in pygame.event.get():

        if event.type==QUIT:

            pygame.quit()

            sys.exit()
added 12 characters in body
Source Link

CORRECT CODE WILL BE LIKE BELOW:

from pygame.locals import * import

import sys,pygame

screen=pygame.display.set_mode((200, 100)) pygame

pygame.display.set_caption("hello")

while(True): for

for event in pygame.event.get(): if event.type==QUIT: pygame.quit() sys.exit()

    if event.type==QUIT:

        pygame.quit()

        sys.exit()

CORRECT CODE WILL BE LIKE BELOW:

from pygame.locals import * import sys,pygame

screen=pygame.display.set_mode((200, 100)) pygame.display.set_caption("hello")

while(True): for event in pygame.event.get(): if event.type==QUIT: pygame.quit() sys.exit()

CORRECT CODE WILL BE LIKE BELOW:

from pygame.locals import *

import sys,pygame

screen=pygame.display.set_mode((200, 100))

pygame.display.set_caption("hello")

while(True):

for event in pygame.event.get():

    if event.type==QUIT:

        pygame.quit()

        sys.exit()
Source Link

CORRECT CODE WILL BE LIKE BELOW:

from pygame.locals import * import sys,pygame

screen=pygame.display.set_mode((200, 100)) pygame.display.set_caption("hello")

while(True): for event in pygame.event.get(): if event.type==QUIT: pygame.quit() sys.exit()