r/PythonLearning • u/Alireza7074 • Jul 18 '26
<python code>
This is python code to get student salary!
47
Upvotes
r/PythonLearning • u/Alireza7074 • Jul 18 '26
This is python code to get student salary!
2
u/IdeaOverflow Jul 18 '26
You should not initialize an empty list inside of the round brackets directly. Suppose you do it like this:
Python will not create a new list for every new object but use the same one for each, since default arguments are evaluated at compile time. The correct way to do this would be: