This may seem like a basic question but I still don't understand classes, I have tried all the tutorials. I tried to build my own class to return the python version and platform version, but it failed. If you guys could look at it and tell me what I am doing wrong, I think I can make better programs for python.
Here is the code:
And here is the output:
Here is the code:
Code:
>>> import sys, os >>> class TestClass: "This class will return your python version and platform." def version(): return sys.version def platform(): return sys.platform
Code:
>>> TestClass.version <unbound method TestClass.version>
Comment