Idiomatic means following the conventions of the language. You want to find the easiest and most common ways of accomplishing a task rather than porting your knowledge from a different language.
non-idiomatic python using a loop with append:
mylist = [1, 2, 3, 4]
newlist = []
for i in mylist:
newlist.append(i * 2)
idiomatic python using a list comprehension:
mylist = [1, 2, 3, 4]
newlist = [(i * 2) for i in mylist]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…