I encountered this python code somewhere:
p = {
s: path.join(
dir , s)
for s in samples
}
Can somebody please explain or point me to documentation on two puzzling aspects of this code?
- You can put the for-loop declaration statement (
for s in samples) after the for-loop body inpython? - The for-loop body has the same indentation a the for-loop declaration statement (
for s in samples)? I thought that the body of a for-loop was required to be indented with respect to the for-loop declaration statement?