Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this program you will be manipulating lists, using if statements, and implementing for loops. The file p 2 . py contains Python code that

In this program you will be manipulating lists, using if statements, and implementing for loops. The file
p2.py contains Python code that loads 3 lists. The lists identify the names and ages of 100 people as follows:
firstnames is a list of each person's first name
lastnames is a list of each person's last name
ages is a list of each person's age.
The lists correspond to each other so that the first name in the firstnames goes with the first name in the lastnames list which goes with the first age in the ages list to describe particular person. We want to divide these list according to each persons age.
Requirements for this program are as follows:
Your program must include a comment header with Author, Assignment (Program 1), Description, and Due Date.
Using the lists provided, you are to create and populate 9 lists as follows:
yfirstnames is a list of first names corresponding to people who are younger than 20
ylastnames is a list of last names corresponding to people who are younger than 20
yages is a list of ages corresponding to people who are younger than 20
mfirstnames is a list of first names corresponding to people who are 20 years old or older and younger than 55
mlastnames is a list of last names corresponding to people who are 20 years old or older and younger than 55
mages is a list of ages corresponding to people who are 20 years old or older and younger than 55
efirstnames is a list of first names corresponding to people who are 55 years old or older
elastnames is a list of last names corresponding to people who are 55 years old or older
eages is a list of ages corresponding to people who are 55 years old or older
Print a formatted table of the young people as follows:
Last Name
samplelast
First Name
samplefirst
Age
There should be one line for each person under that age of 20.
Extra Credit: Create and fill a matrix that contains all of the information about the people. The matrix must be created using Python commands (not manually typed). The beginning of the matrix may look something like this:
[['Lara', 'Laila', 48],['Olson', 'Caiden', 34],['Fischer', 'Isabel', 69],..
image text in transcribed

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

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students also viewed these Databases questions