this post was submitted on 16 Oct 2023
7 points (88.9% liked)

Python

6402 readers
18 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

๐Ÿ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

๐Ÿ Python project:
๐Ÿ’“ Python Community:
โœจ Python Ecosystem:
๐ŸŒŒ Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
 

The thing I love about python is it's elegance; and I thing that is partially due to its syntactic sugar. Between list comprehensions, destructuring, enumerators, generators with yield, and a bunch more, what is your favorite

you are viewing a single comment's thread
view the rest of the comments
[โ€“] namingthingsiseasy 1 points 1 year ago

List comprehensions, dict comprehensions, set comprehensions, and generator expressions. They just make it so fast and easy to transform data.

Also just generators in general. I really like how they save unnecessary computation (when used prudently of course!).

And I'm also a big fan of list indexing, especially how you can extract the last three elements of a list using l[-3:]. Very elegant syntax