Python Loop Appending Same Object Twice
I'm following the YouTube video Learn Python through Data Hacking and am expanding on the sort of 'legacy' inline way by adding classes to learn all the ins and outs of Python OOP.
Solution 1:
It's because of your use of class variables on the Bus class. Make them instance variables (created in __init__
).
Post a Comment for "Python Loop Appending Same Object Twice"