Python Intermediate I Tutorial 3 - List Comprehensions

preview_player
Показать описание

Hi everyone! In today's video we're gonna talk about list comprehensions in python, you probably use lists a lot, for all kinds of stuff, filtering, applying functions and etc. To iterate over a list most people use a for loop, as you would probably do in another languages such as C, C++, C#, Java and more. But Python is well known for being very readable and elegant, pretty is better than ugly, do you
remember that? So when you apply a simple function in a list, you should consider how pretty your code is, this could be seen as shallow,
and actually is, but readable code is very underatted. So help your code readers by using list comprehensions whenever possible.

Рекомендации по теме