Python Forum
May i get help see how am i going,
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
May i get help see how am i going,
#6
Basically:
class Test_it_out:
    def test_it(self, a, b):
        return a*b
    
class Test_it_in :
    def foobar(self, c, d) :
        life = Test_it_out()
        return life.test_it(c,d)

alpha = Test_it_in()
print(alpha.foobar(5,6))
1. Class is not capitalized.
2. Functions defined within a class should have the first argument as self.
3. Instantiate the class before you call a related function. Note the syntax.

K?
Reply


Messages In This Thread
RE: May i get help see how am i going, - by jefsummers - Feb-23-2020, 07:24 PM

Forum Jump:

User Panel Messages

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