Question: PYTHON QUESTION You will be programming anthoney class. There will be only one instance variable (attibute), representing the amount. Include the following A constructor that

PYTHON QUESTION
 PYTHON QUESTION You will be programming anthoney class. There will be

You will be programming anthoney class. There will be only one instance variable (attibute), representing the amount. Include the following A constructor that takes a float argument. Assign the value of the float argument to the instance variable. amount. . Implement the str_ method to display the instance variable amount with a dollarsign in front,comma thousands separator, and 2 digits after the decimal. This method should take no arguments. print(money1)-> $12,345.78 . Implement the add method. This method should take one argument, another money object. This method should return a new money object with an amount that equals the sum of the two money object operands. - money3 money1 + money2 Implement the sub method. This method should take one argument, another money object. This method should return a new money object with an amount that equals the difference between the money objects. - money3 money1 - money2 To test your class, construct 2 money objects with different, nonzero amounts. Print them both. Ad therm together and print the new money object. Subtract one from the other and print the new money object Next . Previous

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!