Mountain high

Report a typo

Objects of the class Mountain have an attribute height defined in its constructor. The value is initially given in meters.

Create a method convert_height that converts the height of the mountain from meters to feet according to the formula Foot=Meter/0.3048Foot = Meter / 0.3048 and then returns the calculated value. This method doesn't take any attributes except for self.

Write a program in Python 3
class Mountain:
def __init__(self, name, height):
self.name = name
self.height = height

# create convert_height here
___

Create a free account to access the full topic