Coding Challenge

Practicing list comprehensions in Transcrypt.

We'll cover the following

Problem statement

We have an application that can only add items to a list for us for now.

List comprehensions provide a concise way to create lists in Python and there are many opportunities to use them when we create applications with React.

The code challenge for this chapter will be to take the ListItems component that we have in app.py and replace the multiline for loop that we used to generate the list of li elements into a Python list comprehension.

In the end the functionality of the application should be the same, yet list comprehension should be used instead of the for loop.

Get hands-on with 1400+ tech skills courses.