in this problem, you will implement a class according to the specifications in the template file usresident.py. the file contains a person class similar to what you have seen in lecture and a usresident class (a subclass of person). person is already implemented for you and you will have to implement two methods of usresident.



Answer :

In this problem, we will implement a class according to the specifications in the template file usresident.py.

For example the following code:

a = US Resident('Tim Beaver', 'Citizen')

a. get Status() print

b = US Resident('Tim Horton', 'Nonresident')

will print:

citizen

## indicates that a Value Error was thrown on the particular line

Class U.S. Residents (Persons):

""" A person who is a resident of the United States. """

def __in it__(self, name, status):

"""

Initialize the Person object. US Resident objects inherit

's Person , with additional attributes.

Status:

One of the strings "citizen", "legal_ resident", or "illegal Residence"

Throws a Value Error if status is not one of these three strings

"""

Person __in it__(self, name)

if status != "citizen" and status != "legal_ resident" and status != "illegal_ resident":

Increase Value Error

self. status = status

def get Status(self):

"""returns the status"""

return self. status

To know more about template file visit;

https://brainly.com/question/20715246

#SPJ4

Other Questions