Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A professor with two assistants, Jamie and Drew, wants an attendance list of the students, in the order that they arrived in the classroom. Drew

image text in transcribed

A professor with two assistants, Jamie and Drew, wants an attendance list of the students, in the order that they arrived in the classroom. Drew was the first one to note which students arrived, and then Jamie took over. After the class, they each entered their lists into the computer and emailed them to the professor, who needs to combine them into one, in the order of each student's arrival. Jamie emailed a follow-up, saying that her list is in reverse order. Complete the steps to combine them into one list as follows: the contents of Drew's list, followed by Jamie's list in reverse order, to get an accurate list of the students as they arrived. 1 - def combine lists(listi, list2): 2 # Generate a new list containing the elements of list2 # Followed by the elements of listi in reverse order Jamies_list = ["Alice", "Cindy", "Bobby", "Jan", "Peter"] Drews_list = ["Mike", "Carol", "Greg", "Marcia"] print(combine_lists (Jamies_list, Drews_list)) 9 2 Use a list comprehension to create a list of squared numbers (n*n). The function receives the variables start and end, and returns a list of squares of consecutive numbers between start and end inclusively. For example, squares(2, 3) should return [4,9). 1 - def squares (start, end): 2 rolurn 1 4 5 6 print(squares (2, 3)) # Should be 14, 91 print(squares (1, 5)) t should be [1, 4, 9, 16, 25] print(squares (@, 1@)) # Should be [@, 1, 4, 9, 16, 25, 36, 49, 64, 81, 1821

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 Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

How much will $119 become if discounted 8% per year for 7 years

Answered: 1 week ago