Stats: 3,011,300 members, 7,360,738 topics. Date: Thursday, 23 March 2023 at 07:20 PM |
Nairaland Forum / Science/Technology / Programming / Tutorial: Object Oriented Programming Paradigm For Beginners in Python (1977 Views)
I Need Help In Object Oriented Programming / Object Oriented Programming / Learn Object Oriented Programming (OOP) AT SANDCROFT SOFTWARE (2) (3) (4)
Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 5:48pm On Apr 14, 2020 |
Hello Nairalands,this was demanded from my thread "common python programming practice". So in this thread,i will try as much as possible to make OOP understandable for anyone who want to learn it. So stay tune as the tutorial will be coming |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by koyla: 6:02pm On Apr 14, 2020 |
Following gbolly1151: |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 7:26pm On Apr 14, 2020 |
Now let me write description of a dog,this will be the basis from which we will learn OOP DESCRIPTION OF A DOG OOP is a programming paradigm that deal with object and class relationship... That statement look too complex to me so am going to break it down in a way we can quickly grab What is an object? Object is anything you can describe e.g the above is the description about Dog,therefore Dog is an object. Noun is an object i.e any name of animal,place or things... Lol i prefer that definition to naming words.other example of object are man,woman,Hausa,pen,pencil, shoe What is a class? Class refer to the framework of an object or noun,in order word what object is made up, it composed of 3 part; 1.name - this is general name of object,that share 'am a', 'is a' or 'is an' relationship with an object e.g1 man is a person,woman is a person. Person is the class name. e.g2 Hausa is a tribe,Youruba is a tribe,Igbo is a tribe. Tribe is the class name In the above description of a dog,we say Dog is an Animal. Animal is the class name 2.Attribute - this hold information about an object,that share 'is' or 'has' relationship with the value e.g it has 4 leg(information about leg),it is fat(information about body) . Look at those statement we can rewrite those as Dog legs is 4, Dog body is fat. The attribute is legs and value is 4. I.e legs=4 The second attribute is body and value is fat i.e body ='fat' 3.method - this tell us about the ability of the object,what the object 'can' do or 'will' do,it is the function the object will perform in the system. From the description of a dog,its abilities are; It can bark,it can bite,it can run Method are bark(),bite(),run() Now let us decrypt that description of Dog to form a class for object Dog
Just snack to chop, write a description about yourself and write out the class name,attribute and method |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 7:26pm On Apr 14, 2020 |
koyla:Posted now |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by koyla: 9:03pm On Apr 14, 2020 |
Thanks much for your effort gbolly1151: 1 Like |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 9:51pm On Apr 14, 2020 |
koyla:You are welcome sir |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 10:19am On Apr 16, 2020 |
I will post some description and will like you guys to write the class structure in this way before will move to next topic in inheritance
|
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 1:10pm On Apr 16, 2020 |
A lion is a species with a short,rounded head, a reduced neck,round ears, and a hairy tuft at the end of its tail. It has prominent mane,which is the most recognisable feature of the species. They can run,jump and do hunt prey. Who is following? |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by Predstan: 1:07am On Apr 20, 2020 |
gbolly1151: Object - Lion Class: Name - Animal Attributes - short, rounded head, , reduced neck, round ears, hairy tufts at the ending of its tail Method - run(), jump(), hunt prey() 1 Like |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 2:36am On Apr 20, 2020 |
Predstan: Well done boss.... but let me comment on your answer head is the attribute name while rounded and short are the values same as other attribute name
You can practice more,just pick up objects around you and describe them I will start inheritance in next update |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by Predstan: 4:47am On Apr 20, 2020 |
gbolly1151: Ok Thanks. |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 10:23am On Apr 21, 2020 |
gbolly1151: Before we move to inheritance, let implement this in python
|
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by Predstan: 12:38pm On Apr 21, 2020 |
gbolly1151: Making sense. Thanks Boss 1 Like |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 4:46pm On Apr 21, 2020 |
Object Relationship Interaction among objects is what lead to a system, the working of a system depends on how these objects interact and these interaction is what we called Relationship. These relationship are of 3 type in OOP; 1. Inheritance 2. Association 3. Composition and Aggregation 1. INHERITANCE : This is the most common relationship among objects that share a relationship 'is a type of' between objects. when two or more objects have slight difference then they must have belong to the same object. When object A,object B,object C are type of Object D we call it inheritance,they are also called generalization. Examples: Teaching staff and Non Teaching staff are type of Staff, saving account and current account are type of bank account Yoruba,igbo,hausa are type of Tribes. Parrot and penguin are type of type Let see a description to understand better DESCRIPTION OF PARROT Parrot is a bird It has feathers It can fly but can't swim DESCRIPTION OF PENGUIN Penguin is a bird It has feather It can't fly but can swim Looking at these two description,we can see that both have common name(bird) and attribute i.e they have feather but different method To prevent repetition of code,we can create a class bird and allow both parrot and penguin to inherit it. To inherit here ,we mean they should have assess to bird class
This actually help us to structure our code and object |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by kunlegboye(m): 6:58pm On May 02, 2020 |
Boss we appreciate your efforts a lot,really educative opened my understanding on the concept of oop. ...We are waiting for the remaining ones...and God will bless you mightily for this 1 Like |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 7:21pm On May 02, 2020 |
kunlegboye:Amen sir....I will try my best sir to keep updating the thread |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by yemyke001(m): 7:34pm On May 02, 2020 |
gbolly1151: Following boss.. This is actually great 1 Like |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 7:43pm On May 02, 2020 |
yemyke001:Alright sir |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 12:02pm On May 04, 2020 |
I dont understand why this forum is giving me on and off....thank God am on today |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by Raalsalghul: 6:48pm On May 04, 2020 |
gbolly1151: I want to learn this stuff, but I'm afraid it might get too complex and I'll stop along the way. ![]() |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 6:34am On May 07, 2020 |
Guys...anytime i tried to post the composition tutorial, i always get kick on,what may cause this? |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by Predstan: 10:47am On May 07, 2020 |
. |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by 6ixT8: 5:25pm On May 08, 2020 |
interesting... gboll1151 where are you |
Re: Tutorial: Object Oriented Programming Paradigm For Beginners in Python by gbolly1151(m): 7:06pm On May 09, 2020 |
6ixT8:Am here, i should have posted the next topic but all the time have been trying to post it,Nairaland will delete it and ban me for a day.....i don't know what is going wrong.....you can get the next topic here on my facebook page https://www.facebook.com/groups/2604470076495701/permalink/2611250559150986/?app=fbl |
(1) (Reply)
Hi, Can Anyone Teach Me Visual Basic 6.0 / Best Programing Schools In Nigeria / Which Programming Pdfs Do You Recommend For A Web Developer?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2023 Oluwaseun Osewa. All rights reserved. See How To Advertise. 122 |