Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,739 members, 7,817,039 topics. Date: Saturday, 04 May 2024 at 12:19 AM

Python Q|A Ask Any Question?? || Or Drop A Python Tip... - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Python Q|A Ask Any Question?? || Or Drop A Python Tip... (1141 Views)

Python Q|A Ask Any Question?? || Or Drop A Python Tip... / Python Q|A Ask Any Question?? || Or Drop A Python Tip... / Are You Interested In GIS Ask Any Question And Learn (2) (3) (4)

(1) (Reply) (Go Down)

Python Q|A Ask Any Question?? || Or Drop A Python Tip... by felicitytips(m): 12:26pm On Oct 20, 2019
Ask any question in python so we can learn together....

Re: Python Q|A Ask Any Question?? || Or Drop A Python Tip... by Samcent: 4:34pm On Oct 20, 2019
you be python guru?

Anyway, there's this challenge I'm facing in a python project I am working on.

I have a class, let's call it class C, that is derived from two classes, let's call them class A and class B (multiple inheritance).
Now, how do I access a method in class B from class C?
Let's call the method 'get_age() ', defined in class B. I want to be able to call this function in class C (something like 'C.get_age()').

I hope my question is clear?
Re: Python Q|A Ask Any Question?? || Or Drop A Python Tip... by follygold: 6:54pm On Oct 20, 2019
please do you have whatsapp number so we can chat better
Re: Python Q|A Ask Any Question?? || Or Drop A Python Tip... by felicitytips(m): 1:45am On Oct 21, 2019
09060253925
Re: Python Q|A Ask Any Question?? || Or Drop A Python Tip... by felicitytips(m): 1:46am On Oct 21, 2019
So this is how to access it with this example..

Re: Python Q|A Ask Any Question?? || Or Drop A Python Tip... by Nobody: 7:17am On Oct 21, 2019
1. Learn to use decorators.
2. Master Libraries like Shutil and Os.
3. Learn Regex. Someone even proposed that Regex should be the first thing to be learnt before proceeding with programming, you can never tell how far it can help you.
4. Python was created with OOP. Even functions are objects. A rule of thumb in Python is "use functions first", if functions doesn't work, then you can consider Class. Though Python supports Multi-Paradigms, it is naturally procedural.
5. Learn to code with PEP8 standard.
6. List comprehension should be used as often as you can.
7. Learn to differentiate between deep and shallow copies. A shallow copy only goes one step deep, in essence...it only make reference to the address of an object. A deep copy is usually recursive, and creates an entirely new object. Good knowledge of this, can save you lots of bug
8. Read the Zen of Python often, it's short but helps one to code the Pythonic way.
9. Learn to use *args, **kwargs, and function unpacking.
10. Use assert statements often, it makes debugging easy. Note, assertion should NEVER be used for data validation.
11. Preach Python.

BTW, I'm a pure amateur in the use of Python. I'd like someone really good to mentor me.
Re: Python Q|A Ask Any Question?? || Or Drop A Python Tip... by felicitytips(m): 8:06am On Oct 21, 2019
We got you covered here what part of python do you want to learn??
Re: Python Q|A Ask Any Question?? || Or Drop A Python Tip... by Samcent: 8:32am On Oct 21, 2019
felicitytips:
So this is how to access it with this example..
I will try this out.
Thanks a lot.

1 Like

Re: Python Q|A Ask Any Question?? || Or Drop A Python Tip... by Samcent: 8:37am On Oct 21, 2019
felicitytips:
We got you covered here what part of python do you want to learn??
Let's start with the first he mentioned - DECORATORS.

1 Like

Re: Python Q|A Ask Any Question?? || Or Drop A Python Tip... by felicitytips(m): 9:42am On Oct 21, 2019
Decorators allows programmers to modify the behavior of function or class.
I know of @staticmethod, @classicmethod, and @property
I will send you examples as screen shots.
Re: Python Q|A Ask Any Question?? || Or Drop A Python Tip... by Nobody: 9:49am On Oct 21, 2019
felicitytips:
Decorators allows programmers to modify the behavior of function or class.
I know of @staticmethod, @classicmethod, and @property
I will send you examples as screen shots.
Decorators are not necessarily limited to those, in fact what you mentioned were in-built ones.
A Pythonista is most likely going to decorate other functions with a user defined decorator. Though Decorators are hard to understand but any Python programmer without in-depth knowledge of Decorators is probably playing with Turtle �.

I can't overemphasize their prowess.

1 Like

Re: Python Q|A Ask Any Question?? || Or Drop A Python Tip... by felicitytips(m): 9:53am On Oct 21, 2019
IamTeen:

Decorators are not necessarily limited to those, in fact what you mentioned were in-built ones.
A Pythonista is most likely going to decorate other functions with a user defined decorator. Though Decorators are hard to understand but any Python programmer without in-depth knowledge of Decorators is probably playing with Turtle �.

I can't overemphasize their prowess.
Yes I know. This is what I will cover here and you can also contribute as well.
Re: Python Q|A Ask Any Question?? || Or Drop A Python Tip... by Nobody: 9:59am On Oct 21, 2019
felicitytips:

Yes I know. This is what I will cover here and you can also contribute as well.
Yes sir, I'm just an amateur; so no contribution. However, I'll be waiting eagerly for your contributions sir.

(1) (Reply)

Do You Think Nairaland Really Has 2,359,209 Members? / I Want A Forex Tutor. / Sms Software

(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 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.