Nov-22-2018, 02:18 AM
Look back at post #13, you have
I think the easiest solution here would be to remove that parameter from the parameter list. Instead just have
home_results = []
in the initialization. That's a problem. Lists are mutable, the are just passed as a reference to the list, not a copy of the list. Also, default parameters are stored in the function or method, and are not resolved every time the method is called. So every team's home_results is referencing the same list. That's why they have the same values in them.I think the easiest solution here would be to remove that parameter from the parameter list. Instead just have
home_results = []
in the body of the __init__ method. If it's in the body of the code, it will be resolved fresh each time the code is run, and you'll get five different lists.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures