Link to home
Start Free TrialLog in
Avatar of chalie001
chalie001

asked on

SyntaxError: positional argument follows keyword argument

hi am geting the following error
User generated image
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pepr
pepr

To add to the Neeraj precise comment... The rule is that once you use the named argument, the following arguments must be also named. Otherwise, it is not clear what the following positional arguments would mean. Think about the situation like this:
def myfunction(first, second):
    print('first:', first)
    print('second:', second)

myfunction(second=2, 1)

Open in new window

If it were allowed, what output would you expect? What would be the 1?