How are \"keyword arguments\" different from regular arguments? Can\'t all arguments be passed as name=value
instead of using positional syntax?
They have no keywords before them. The order is important!
func(1,2,3, "foo")
They have keywords in the front. They can be in any order!
func(foo="bar", baz=5, hello=123)
func(baz=5, foo="bar", hello=123)
You should also know that if you use default arguments and neglect to insert the keywords, then the order will then matter!
def func(foo=1, baz=2, hello=3): ...
func("bar", 5, 123)