对新手问题感到抱歉,但我对编程很陌生。我的问题是,当从父类继承的属性多于我需要的属性时,如何将其中一个属性设置为等于另一个属性?这是一个例子:
class numbers():
def __init__(self, x, y, z):
# x, y and z initialized here
class new_numbers(numbers):
def __init__(self, x, y):
numbers.__init__(self, x, y=x, z)
# what im trying to do is get the y attribute in the subclass to be equal to the x attribute, so that when the user is prompted, they enter the x and z values only.
谢谢你的帮助!