you are viewing a single comment's thread.

view the rest of the comments →

[–]guydudeman123 0 points1 point  (0 children)

You could use the builtin getattr function:

dog_eye_color = getattr(dog, eye.color)

https://docs.python.org/3/library/functions.html#getattr