Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The goal here is count the number of elements in number_list that are in check_list. In order to do this, youll want to use a

The goal here is count the number of elements in number_list that are in check_list. In order to do this, youll want to use a for-loop to iterate through number_list. number_list = [3, 3, 28, 27, 14, 27, 6, 19, 12, 12, 25, 6, 9, 15, 9, 23, 19, 23, 3, 27, 9, 24, 22, 6, 0, 25, 3, 23, 20, 25, 22, 14, 29, 21, 1, 2, 22, 12, 1, 7, 18, 26, 17, 6, 10, 12, 8, 23, 20, 22, 4, 5, 8, 1, 25, 9, 8, 4, 29, 13] check_list = [2, 34, 29, 17, 17, 29, 23, 27, 30, 26] Once you determine whether each value from number_list is in check_list, count them and print out the result. In order to accomplish the assignment, youll want create a for-loop that iterates through number_list. Inside that loop, check if the value from number_list is in check_list, and if so, append it to a new list you created. (That new list should be created before the for-loop.) Finally, count the number of elements in that new list.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions