Mar-05-2020, 03:23 PM
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:
here is the code:
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 callI 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