Menu

Please Change This So That If Selected The Apartment Number Prints Before The House Number With A – In Between Class Address: #Define Class Def __init__(Self, House_number, Street, City, Province, Postal_code, Apartment_number=None): Self.House_number = House_number

Please Change This So That If Selected The Apartment Number Prints Before The House Number With A – In Between Class Address: #Define Class Def __init__(Self, House_number, Street, City, Province, Postal_code, Apartment_number=None): Self.House_number = House_number
Please change this so that if selected the apartment number prints before the house number with a

in between class Address: #define class
def
_
_
init
_
_
(
self
,
house
_
number, street, city, province, postal
_
code, apartment
_
number
=
None
)
:
self.house
_
number
=
house
_
number #initialize attributes
self.street
=
street
self.apartment
_
number
=
apartment
_
number # allows an object to be created with and apartment number or not
self.city
=
city
self.province
=
province
self.postal
_
code
=
postal
_
code
def print
_
address
(
self
)
: #method to print details
print
(
f

{
self
.
house
_
number
}

{
self
.
street
}

)
#house number and street
if self.apartment
_
number is not None:
print
(
f

{
self
.
apartment
_
number
}

)
print
(
f

{
self
.
city
}
,

{
self
.
province
}

{
self
.
postal
_
code
}

)
house
_
number
=
input
(

Enter house number:

)
street
=
input
(

Enter street:

)
city
=
input
(

Enter city:

)
province
=
input
(

Enter province:

)
postal
_
code
=
input
(

Enter postal code:

)
apartment
_
number
_
input
=
input
(

Do you have an apartment number?
(
yes
/
no
)
:

)
.
lower
(
)
if apartment
_
number
_
input
=
=
“yes”:
apartment
_
number
=
input
(

Enter apartment number:

)
address
=
Address
(
apartment
_
number, house
_
number, street, city, province, postal
_
code
)
else:
address
=
Address
(
house
_
number, street, city, province, postal
_
code
)
print
(

Address:”
)
address.print
_
address
(
)
Expert Answer
Step 1
The necessary changes to the provided code and provide a step-by-step:

1.Class Definition
I

OR