Python Forum
how do i fix this problem - IndentationError?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do i fix this problem - IndentationError?
#1
I have never does any type of coding before and wanted to give it a try. I am using the book called python hunting. they told me to type this codes first so that I can load up pygame and eventually start developing games.


import pygame, sys
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((640,480))
while 1:
    for event in pygame.event.get():
	    if event.type == pygame.QUIT:
		    sys.exit()
	screen.fill((255,255,255))
    pygame.draw.circle(screen,(0,255,0),(100,100),20)
    pygame.display.update()
But whenever I try to open this file on python itself common Prompt(CMD) keeps telling me

line 9
screen.fill((255,255,255))

IndentationError: unindent does not match any outer indentation level

what does this mean???? how do I correct this???? Can someone please help. I have been trying to creak my head on this for more than 1 month now. A help will be really appreciated. Thankyou.
Reply


Messages In This Thread
how do i fix this problem - IndentationError? - by GrandMaster101 - Mar-12-2019, 08:47 AM
RE: how do i fix this problem??? - by Larz60+ - Mar-12-2019, 09:04 AM
RE: how do i fix this problem??? - by perfringo - Mar-12-2019, 09:13 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  IndentationError: unexpected indent dee 3 2,331 May-02-2022, 02:15 AM
Last Post: dee
  error "IndentationError: expected an indented block" axa 4 2,934 Sep-08-2020, 02:09 PM
Last Post: ibreeden
  IndentationError: unexpected indent jk91 1 2,394 Feb-27-2020, 08:56 PM
Last Post: buran
  IndentationError jagannath 1 2,480 Nov-04-2019, 07:41 AM
Last Post: buran
  IndentationError: expected an indented block ryder5227 2 2,623 Sep-27-2019, 06:59 PM
Last Post: jefsummers
  IndentationError on installed package evvvonder 3 3,052 Jun-29-2019, 10:30 PM
Last Post: Gribouillis
  Indentationerror Jack_Sparrow 4 4,223 May-16-2018, 05:50 PM
Last Post: Jack_Sparrow
  IndentationError message could be confusing to new programmers insearchofanswers87 1 2,353 May-16-2018, 05:05 PM
Last Post: Larz60+
  IndentationError: unexpected indent (Python) segs 8 17,311 Aug-11-2017, 03:13 PM
Last Post: segs

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020