Question: The script should first read a file line by line, where each line is a person's information formatted as FirstName LastName, YYYY - MM -

The script should first read a file line by line, where each line is a person's information
formatted as "FirstName LastName, YYYY-MM-DD, City, Country".
2. The script should filter the lines to only include people who are from a city that
contains two or more words (e.g., "San Francisco"). Use a regular expression to check
this.
3. For each of the filtered lines, the script should extract the person's age in years, based
on the date of birth. You'll need to use a regular expression to extract the date of birth and
then calculate the age.
4. After all ages are calculated, sort the people by their ages in descending order and print
each person's name along with their age.
Note: You can assume that the current y

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!