Learn Languages (Python!) Idiomatically

<!-- EXAMPLE -->
Input: arr = [17,18,5,4,6,1]
Output: [18,6,6,6,1,-1]

1. SOLUTION

2. LESSON: LEARNING LANGUAGES IDIOMATICALLY

  • The lesson seems to be that you must know pythons idiomatically, where it combines the pythonic backward traversal with range(len(arr) -1,-1,-1) and value swapping via tuple unpacking
  • Even though Paul Graham suggests (rightly?) that
  • I counter “equivalence of languages” with the example above, boosted with prof. Sussman’s observation that essential to learning a language is not just to learn about its primitives, collections, and syntax, but — essentially — about its idioms

3. LINKS

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pavol Kutaj

Pavol Kutaj

Infrastructure Support Engineer/Technical Writer (Snowplow Analytics) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com