As a very noob with in Python I'm printing all elements of a list in version 3, and after a comprehensive research I couldn't find an explanation for this kind of behavior.
However, I know every function must return some value and when it's not defined the function returns "Null" (or "None" in Python). But why in this case, after printing all elements correctly it prints "None" for each element in another list?
>>> a_list = [1,2]
>>> a_list
[1, 2]
>>> [print(f) for f in a_list]
1
2
[None, None]
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…