Liu Zuo Lin
Mar 29, 2023

--

Fair point, but I included 'for i in range(len(list))' as a teaching tool for beginners rather than the absolute most pythonic way to achieve something.

1. I usually get 'wtf?' reactions when I try to teach absolute beginners how to use enumerate

2. beginner learners usually understand 'range(len(list))' better, and this can be extended to 'range(len(list)-1' and so on

3. beginner learners that I teach usually use 'range(len(list))' first until some degree of comfort before evolving to use enumerate

--

--

Liu Zuo Lin
Liu Zuo Lin

Written by Liu Zuo Lin

SWE @ Meta | [Ebook] 101 Things I Never Knew About Python: https://payhip.com/b/vywcf

Responses (1)