Former js dev here. I am writing a program (for school) and I need a list filled with turtle objects. However, I need to add an attribute "speed" to the list.
I know in javascript, it would be something like:
let a = [];
a.speed = 5
And then I would make a factory function for turtles using that speed attribute. I tried this in python:
turtles = [Turtle()]
turtles.speed = 10
And it threw the error: 'AttributeError: 'list' object has no attribute 'speed' on line 9'
Any Suggestions?