Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/09-Empty-Section-Skip/08-Built-in Functions Assessment Test.ipynb
Views: 648
Built-in Functions Test
For this test, you should use built-in functions and be able to write the requested functions in one line.
Problem 1
Use map() to create a function which finds the length of each word in the phrase (broken by spaces) and returns the values in a list.
The function will have an input of a string, and output a list of integers.
Problem 2
Use reduce() to take a list of digits and return the number that they correspond to. For example, [1, 2, 3] corresponds to one-hundred-twenty-three.
Do not convert the integers to strings!
Problem 3
Use filter to return the words from a list of words which start with a target letter.
Problem 4
Use zip() and a list comprehension to return a list of the same length where each value is the two strings from L1 and L2 concatenated together with connector between them. Look at the example output below:
Problem 5
Use enumerate() and other skills to return a dictionary which has the values of the list as keys and the index as the value. You may assume that a value will only appear once in the given list.
Problem 6
Use enumerate() and other skills from above to return the count of the number of items in the list whose value equals its index.