Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python please Part I: Validate Street Addresses (10 points) Write a function street.addresses (), which takes a single argument addresses, which is a list

In python please
image text in transcribed
image text in transcribed
image text in transcribed
Part I: Validate Street Addresses (10 points) Write a function street.addresses (), which takes a single argument addresses, which is a list of strings. The function analyzes each string, and, if the string's format matches the pattern of a valid street address as described below, the function appends the string's index in addresses into a returned list. A validly formatted address is defined by the following components, in the given order: 1. one or more digits 2. exactly one space 3. an uppercase letter, followed by any combination of uppercase letters, lowercase letters and spaces 4. exactly one space 5. the word'Street', 'Road' or Path', capitalized exactly as given 6. optionally, the following text: a. exactly one space b. the string'Apt.',capitalized exactly as given c. exactly one space d. exactly one uppercase letter Examples of validly formatted addresses are ' 58 Gnarled Oak Street' and '173 East Main Road Apt. Q Suppose the following list were pased as addresses E', '6 E1m Path Apt. 5' '21 Main Street','12 Main Drive, 5 Elm Apt. E The function would return [o, 3] because only the first and last strings in this example match the pattern defined above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

ISBN: 0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

What is electric dipole explain with example

Answered: 1 week ago

Question

What is polarization? Describe it with examples.

Answered: 1 week ago