the function might do validation, the value could come from the user and might need validating (minimum length for example) before the value is added to the dictionary/object.
the function could also eliminate duplicate code.
you will run more into this issue during the lessons, a certain concept might seem a bit overkill/abstract but can be useful later when the program you are building might become more complex.
When a program is running we do not have manual access to the code or data structures. That’s why the language has built in functions that allow the program to manipulate those objects dynamically and on the fly.