Ask Your Question

interact variables work differently

asked 2020-10-29 02:07:48 +0200

cybervigilante gravatar image

This interact works but I'm unclear why I only need n in the body of the function, but ymax alone fails. I have to make it ymax=ymax. They should both work the same.

def _(n=(1,20),ymax=(50,200)):
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-01-02 14:03:10 +0200

slelievre gravatar image

This is because of the difference between positional arguments and keyword arguments in Python functions.

More detail can be found in the Python documentation

Tutorials can also be found by querying web search engines for [ positional arguments keyword arguments Python ].

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2020-10-29 02:07:48 +0200

Seen: 72 times

Last updated: Jan 02