function addremove( x=100, y=10)
I can put second argument as default value by
and this will result (20, 0)
but how can I put first argument as default and input only second argument?
I remember some functions in other modules were defined in such a way and worked well.
If you want to keep this positional then you can define
addremove(x, y) without defaults and also define this:
addremove(y) = addremove(default_x, y)
All that default argument syntax does is define such methods for you.
This is generally only used when the first argument(s) have a different type (eg
While there is nothing wrong with it per se, it may be somewhat confusing and unexpected for arguments of the same type.