May 2021
Intermediate to advanced
630 pages
15h 31m
English
Many programmers come to Python with prior experience of other programming languages. It happens often that they are already familiar with programming idioms of those languages and try to replicate them in Python. As every programming language is unique, bringing such foreign idioms often leads to overly verbose or suboptimal code.
The classic example of a foreign idiom that is often used by inexperienced programmers is iteration over lists. Someone that is familiar with arrays in the C language could write Python code similar to the following example:
for index in range(len(some_list)):
print(some_list[index])
An experienced Pythonic programmer would most probably write:
for item in some_list: print(item) ...