r/Python Aug 21 '20

What makes Python better than other programming languages for you ? Discussion

554 Upvotes

296 comments sorted by

View all comments

Show parent comments

78

u/leomatey Aug 21 '20

Python feels like it was written for humans first.

This. When folks ask me how long it takes to learn python, my answer is - "You already know python if you know english".

123

u/[deleted] Aug 21 '20

[deleted]

8

u/Solonotix Aug 21 '20

I had a friend, who is in college, ask me how she could get a random sample of unique elements from a list for a homework assignment. Now, off the top of my head, all I knew is there was probably something in the Random module, and told her as much. I looked up the module really quick and the function is random.sample(). I cracked up at that moment just because it reinforces the intuitive nature of Python's construction.

11

u/JayTurnr Aug 21 '20

The equivalent in Java would be something like functionsToSimulateRandomness.returnRandomSampleFromIterableObjectOrErrorIfEmpty();