Python loop appending same object twice

后端 未结 1 1575
终归单人心
终归单人心 2021-01-27 07:07

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 Pytho

相关标签:
1条回答
  • 2021-01-27 07:24

    It's because of your use of class variables on the Bus class. Make them instance variables (created in __init__).

    0 讨论(0)
提交回复
热议问题