Question: 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 testsPlease check if your code passes the tests Write a list comprehension

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

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 Databases Questions!