Python 2.7 IndentationError -


i getting indentationerror when trying run program in python interpreter:

 line 127     global map          ^ indentationerror: expected indented block 

i using python version 2.7

what's wrong following code?:

def make_map(): global map 

python expects 4 spaces or tab indent , align code - similar java expecting curly {} brackets start of loop, method or class etc.

def some_function(): somecode morecode ... 

should formatted as

def some_function():     somecode     morecode     ... 

it appears code throws exception on line 127, check , indent code required.

def some_code():     in range(1, some_value):         some_method()          if need_more_indent:             indent_code()          do_this_after_indent_code()      this_runs_after_for_loop()      return 'lol' 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -