function - SOLVED Python, Expected an indented block? One complication -
i'm trying make quick text based hockey team management game, whenever reference 1 of functions 'expected indented block'. not sure if i'm stupid , can't find mistake or something.
def startup(): print "welcome text based hockey league!" print "you tasked being team's general manager" yourteam = raw_input() class tbhl: def __init__(self): self.teamlist["mustangs", "wolves", "indians", "tigers", "bears", "eagles", yourteam] class game: def __init__(self, homescore, awayscore): #games left in team class startup() #<-the line error points tbhl = tbhl() print tbhl.teamlist[7]
when have commented out block code function, use keyword pass
prevent error. code block starts new line of indentation cannot left blank (or comments.)
... class game: def __init__(self, homescore, awayscore): #games left in team class pass
pass
no-op please compiler when looks @ indentation level.
Comments
Post a Comment