List Comprehensions Using Conditions
Learn how to use a list comprehension with a condition.
We'll cover the following...
Imagine you want to find the square root of every value in a list, but you want to ignore any negative values so that they don’t even appear in the output list. Here is how you might do it with a loop:
Access this course and 1400+ top-rated courses and projects.