Question: Consider the following code: @dataclass class Multiplier: num 1 :int = 0 num 2 :int = 0 def getProduct ( self ) : return self.num

Consider the following code:
@dataclass
class Multiplier:
num1:int =0
num2:int =0
def getProduct(self):
return self.num1* self.num2
def main():
m = Multiplier()
m.num1=7
m.num2=3
print(f"{m.num1} X {m.num2}={m.getProduct()}")
if _name_=="_main_":
main()
What is (are) the attributes of the class?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!