Skip to content Skip to sidebar Skip to footer

Python Default Argument Syntax Error

I just wrote a small text class in python for a game written using pygame and for some reason my default arguments aren't working. I tried looking at the python documentation to se

Solution 1:

def __init__(self,screen,x_location='center',y_location='center',writeable,color,size=12):

You have defined non-default arguments after default arguments, this is not allowed. You should use:

def __init__(self,screen,writeable,color,x_location='center',y_location='center',size=12):

Post a Comment for "Python Default Argument Syntax Error"