Hi my name is Paul and I've been using Python about a week. Kind of getting to grips with it and making progress . Upto now and for the last 16 months I've been using AGK2 and have had some success with it and produced a few games . One thing which I don't understand is the class thing . What is it and how does it work in a nice simple to understand explanation please . thanks.
New to python, i would like to know what a class is ?
New to python, i would like to know what a class is ?
|
May-11-2019, 07:26 AM
check our tutorial on class basics
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link Create MCV example Debug small programs
May-11-2019, 07:44 AM
The "class thing" is whole concept for programming languages.
Other concepts: imperative, declarative, functional With a class you define a behavior of an object. A class is like a construction plan for objects. A class instantiates an object and the object follows the rules of the class. The object has attributes and methods. You can read and write the attributes. A method should do something with the object. The other very important topic is inheritance. If you have a general class for Bricks, you can inherit from the Bricks class and make Special_Bricks. The class Special_Bricks inherits all methods and attributes from the Bricks class. Additional features and properties are added to the Special_Bricks class. If you change the Bricks class, the Special_Bricks class is also affected.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
May-11-2019, 07:55 AM
Ok thanks for the reply it took me a while to get my head around arrays too. I get the inheritance thing at least. I'll probably understand it more and where to use it as I go further into it. I've spent the last 16 months learning AGK2 but decided I wanted to learn a professional language so here I am . I've only ever used BASIC so oop is a new concept to me . So far so good really liking Python.
|
|
Users browsing this thread: 3 Guest(s)