Question: Write a class called Height. A Height represents a height in feet and inches. It should have a constructor, __str__ and __repr__ methods, and an

Write a class called Height. A Height represents a height in feet and inches. It should have a constructor, __str__ and __repr__ methods, and an add method. The __str__ method should be written to follow this example:

>>>h = Height(15,6) >>>print(h) 15' 6" 

The add should add 2 heights, and be written so that it is nondestrutive.

python 2.7.13

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!