Skip to content
Advertisement

Share attributes/ variables between classes python

JavaScript
JavaScript

Advertisement

Answer

Your issue here is that you’re trying to access local variables instead of instance attributes.

Here’s how you should do it:

JavaScript

From the console output:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement