Question: Examine the starter code in the editor window, and run the code in the interpreter. The function extract _ even _ numbers _ in _

Examine the starter code in the editor window, and run the code in the interpreter.
The function extract_even_numbers_in_list extracts the elements of a list that are even. The list my_evens has been created by calling this function on my_list. Inspect the data in my_evens.
In the code editor:
Create a new list called my_evens2 by using a list comprehension that does the same thing as extract_even_numbers_in_list, but all in one line.
The function extract_digits_from_string extracts the characters in a string that are digits. In this function, the method string.is_digit is used to test whether or not a string is a digit (or collection of digits). The list str_digits has been created by calling this function on the supplied string s. Inspect the data in str_digits.
Create a new list called str_digits2 by using a list comprehension that does the same thing as extract_digits_from_string, but all in one line.
Before testing your code for correctness with the button below, run %run exercise.py in the terminal to ensure the file runs with no errors. If there are errors, use the information from them to debug your code.

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!