Apr-19-2024, 01:53 PM
(This post was last modified: Apr-19-2024, 01:53 PM by deanhystad.)
self is the first argument to any instance method. It is the instance that called the method. In your example:
/ in the argument list indicates that all arguments left of the / are position only arguments. This is why you got an error when trying to use the keyword "default". * is a similar delimiter. All arguments right of * are keyword only arguments. You can read about them here:
https://realpython.com/python-asterisk-a...arameters/
dict_1.get('ali')"self" in get() would be dict_1.
/ in the argument list indicates that all arguments left of the / are position only arguments. This is why you got an error when trying to use the keyword "default". * is a similar delimiter. All arguments right of * are keyword only arguments. You can read about them here:
https://realpython.com/python-asterisk-a...arameters/