擅长:python、mysql、java
<p>或者你可以:</p>
<pre><code>class calculator():
def addition(self, x, y):
return x + y
def subtraction(self, x, y):
if x > y:
return y - x
else:
return x - y
first = calculator()
print(first.subtraction(1, 2))
</code></pre>
<p>也不完全确定x>;y:是否是您的意图,或者如果x<;y:</p>