Question: def format _ address ( address _ string ) : house _ number = street _ name = # Separate the

def format_address(address_string):
house_number =""
street_name =""
# Separate the house number from the street name.
address_parts =___
for address_part in address_parts:
# Complete the if-statement with a string method.
if ___
house_number = address_part
else:
street_name += address_part +""
# Remove the extra space at the end of the last "street_name".
street_name =___
# Use a string method to return the required formatted string.
return ___
print(format_address("123 Main Street"))
# Should print: "House number 123 on a street named Main Street"
print(format_address("10011st Ave"))
# Should print: "House number 1001 on a street named 1st Ave"
print(format_address("55 North Center Drive"))
# Should print "House number 55 on a street named North Center Drive"

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 Programming Questions!