Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please check if your code passes the tests Write a list comprehension to create a list with values [101,97,93,89,,87,91,95,99] Save the result as P2. #

Please check if your code passes the testsimage text in transcribed

Write a list comprehension to create a list with values [101,97,93,89,,87,91,95,99] Save the result as P2. \# YOUR CODE HERE "Check if P2 is a list of length 51. (1 mark)" assert isinstance(P2,list) , "P2 should be a list." assert len (P2)==51, "P2 should be a list of length 51." print("Problem 2 Test 1: Success!") "Check if P2 has the correct values in the list. This cell contains hidden tests. (2 marks)" assert P2[:4] ==[101,97,93,89], "First 4 values of P2 are 101,97,93,89." print("Problem 2 Test 2: Success!")

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

More Books

Students also viewed these Databases questions