Python Forum
How can I sum up the values of two functions?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I sum up the values of two functions?
#1
Hi,

I have two classes. In class B I want to change the values of the variables in class A, which are defined in functions: some and anyt, with the help of the functions in class B: frog and lion.
For example, I multiply by 2 or 3..

I get the Error:
  File "E:/Python/Akustik/Akustik/Test.py", line 20
    A.some(a,b,c)  = A.some(a,b,c)* 2
    ^
SyntaxError: can't assign to function call
I know what does that mean, but i can't dispense with the functions in class A and B, does anybody have a tip?

here is the code:
class A:
    
    def some(self,a, b, c):
    
        self.a = 4
        self.b = 2
        self.c = 3
        
    def anyt(self, p, g, f):
    
        self.p = 5
        self.g = 8
        self.f = 1
        
    
class B(A):
    
    def frog(self):
            
        A.some(a,b,c)  = A.some(a,b,c)* 2
       
                
    def lion(self):
            
        A.anyt(p,g,f)= A.anyt(p,g,f) * 3
 
Reply


Messages In This Thread
How can I sum up the values of two functions? - by Jionni - Mar-05-2020, 03:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  partial functions before knowing the values mikisDeWitte 4 685 Dec-24-2023, 10:00 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

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