Python classes

I made a class for a project I’m working on that initialized this:

 def __init__(self, name = None, group, phone_number):

I got this error:

non-default argument follows default argument

what does it mean? and how can I fix it?

this is a default argument:

name = None

now the name parameters has a default value (None) for the argument, followed by non-default argument group

default arguments always has to be after non-default arguments.

so you need to change parameters order

1 Like

thanks a lot @stetim94, that really helped me!

1 Like

This topic was automatically closed 18 hours after the last reply. New replies are no longer allowed.