0
How to run a list of objects (python)
I have a tutorial code in the making, as I was testing some of the code, I came across this error. I stored 10 objects in a list, I then tried to loop through and run them all. How can I do this? I keep getting "indices must be integers or slices, not Thing" https://code.sololearn.com/cndn7I2RwlU4/?ref=app
2 ответов
+ 3
in your static method, hello needs to be a string. also, since youre in a loop, youve already acessed the list, no need for index
https://code.sololearn.com/cH26EVnuNG7o/?ref=app
+ 2
Thanks so much Slick! I had no idea it wasn't a string the whole time!