Question: Code Example 1 4 - 3 @dataclass class Multiplier: num 1 :int = 0 num 2 :int = 0 def getProduct ( self ) :

Code Example 14-3
@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()
Refer to Code Example 14-3: What is (are) the attributes of the class?
a. m
b. m.num1, m.num2
c. num1, num2
d. getProduct()

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 Programming Questions!