how to use enumerate instead of range and len

Solutions on MaxInterview for how to use enumerate instead of range and len by the best coders in the world

showing results for - "how to use enumerate instead of range and len"
Valeria
22 Jan 2017
1using enumerate instead of range or len
2a = [f(n) for n, _ in enumerate(L)]
3
4using range and len
5a = [f(n) for n in range(len(L))]