Firstly it helps if you format your code properly as shown:
class A():
def EM (self,a,b):
self.a=a
self.b=b
w=a+b
print(w)
def number(self,c,d):
self.c=c
self.d=d
v=c-d
print(d)
def q (self,v,w) ##problrm here
qq=v+w
print(qq)
But to answer your question you would use the results for EM
and number
as shown
instance = A()
result = instance.q(instance.EM(a, b), instance.number(c, d))
Because you want to use multiple method results as parameters you have to do it outside of those methods although you could create a new method to make it look better like
class A():
def EM (self,a,b):
self.a=a
self.b=b
w=a+b
return w
def number(self,c,d):
self.c=c
self.d=d
v=c-d
return d
def q (self,v,w)
qq=v+w
return qq
def doThisThing(a, b, c, d):
return self.q(self.EM(a, b), self.number(c, d))
Notice how I've changed the prints to returns as instead of displaying the result to the console we want to pass the result to the caller. If you wanted to now display the result you could use
print(instance.doThisThing(a, b, c, d))