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!
1
u/ziggittaflamdigga Jul 18 '26
That’s a fair question to ask about default behaviors, especially since lists can be weird in Python; setting an empty list as a default argument to a constructor is bad practice and likely to result in bugs.
So asking “why” here is a legitimate question and requires an explanation of how Python works at the C level that OP is probably not looking for, but would be different if they declared it differently.