I want to learn Python, but I simply can’t get this to work. its really strange …
I have two small code snippets posted here, when they reside in the same tab it works!. But if I put the class into its own tab I get a NameError(?). How can I get this to work properly?
In the main tab I have;
p1 = MyClass() print(p1.x)
in the second tab I have;
class MyClass(object): x = 5