Python Forum
Using one method's result for another method in the same Class?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using one method's result for another method in the same Class?
#2
Sure. Normally you'll just use self to call the method. Something like:

def get_amount_inside(self):
    area = self.get_area()
    # do more stuff using the area....
get_area() is a method (function), not an attribute. So you need the parenthesis to call it.
Reply


Messages In This Thread
RE: Using one method's result for another method in the same Class? - by bowlofred - Sep-12-2020, 10:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Method returning None husksedgier 2 299 May-04-2024, 06:38 PM
Last Post: husksedgier
  Int.From_Bytes Method - Conversion of Non-Escaped Bytes Objects new_coder_231013 2 487 Apr-06-2024, 04:24 PM
Last Post: new_coder_231013
  Why is the copy method name in python list copy and not `__copy__`? YouHoGeon 2 334 Apr-04-2024, 01:18 AM
Last Post: YouHoGeon
  class definition and problem with a method HerrAyas 2 328 Apr-01-2024, 03:34 PM
Last Post: HerrAyas
  Operation result class SirDonkey 6 639 Feb-25-2024, 10:53 AM
Last Post: Gribouillis
  super() and order of running method in class inheritance akbarza 7 861 Feb-04-2024, 09:35 AM
Last Post: Gribouillis
  problem usage of static method akbarza 5 612 Feb-03-2024, 07:43 AM
Last Post: paul18fr
  Building a DoublyLinkedList in Python - - append method Drone4four 2 477 Jan-08-2024, 01:27 PM
Last Post: Drone4four
Information Best distribution method inovermyhead100 0 603 Jul-19-2023, 07:39 AM
Last Post: inovermyhead100
  method call help sollarriiii 6 1,250 Feb-21-2023, 03:19 AM
Last Post: noisefloor

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020