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 extractevennumbersinlist extracts the elements of a list that are even. The list myevens has been created by calling this function on mylist. Inspect the data in myevens.
In the code editor:
Create a new list called myevens by using a list comprehension that does the same thing as extractevennumbersinlist, but all in one line.
The function extractdigitsfromstring extracts the characters in a string that are digits. In this function, the method string.isdigit is used to test whether or not a string is a digit or collection of digits The list strdigits has been created by calling this function on the supplied string s Inspect the data in strdigits.
Create a new list called strdigits by using a list comprehension that does the same thing as extractdigitsfromstring, 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
