Answer to Question #320189 in Python for Carla May A. Laput

Question #320189

Create a program with two methods, one method for displaying your full name and the




other method displays your address.

1
Expert's answer
2022-03-29T07:41:29-0400

Here is the program bearing the two methods:

# A program with two methods
class Person():
    """Representing a person."""
    def __init__(self, first_name, last_name, street, city, state, ZIP_code):
        """Initialize the name and address attributes."""
        self.first_name = first_name
        self.last_name = last_name
        self.street = street
        self.city = city
        self.state = state
        self.ZIP_code = ZIP_code

    def get_full_name(self):
        """Print a neatly formatted full name."""
        full_name = self.first_name + ' ' + self.last_name
        return full_name.title()

    def get_address(self):
        """Print the person's address."""
        address = self.street.title() + ", " + self.city.title() + ", " + \
                  self.state.upper() + " " + str(self.ZIP_code)
        return address

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS