Python Basics Lambda List Comp Dict Comp and Node Lists

Veröffentlicht am: 17 Juni 2026
auf dem Kanal: Stephen Blum
56
5

Today we are learning Python list comprehension, dictionary comprehension, and lambda. Lambda lets you write a small function inline, like lambda n: n * 2, and you can pass that function into another function. We used that idea to manipulate numbers, like doubling a value or adding 10.

We also used filter with a lambda to keep only numbers that are five or more. Next we sorted a list of chatters with scores using sorted and a key function, like key=lambda c: c[1], and we flipped it to descending order by using a negative value. After that, we reviewed list comprehension as a for loop inside brackets that builds a new list, and we added an if at the end to filter items.

Finally we looked at dictionary comprehension and simplified it by removing enumerate when it was not needed, which made the code cleaner while still filtering out None values.


Auf dieser Seite können Sie das Online-Video Python Basics Lambda List Comp Dict Comp and Node Lists mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Stephen Blum 17 Juni 2026 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 56 Mal angesehen und es wurde von 5 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!