- #1
member 428835
Hi All
I'm learning python and have never seen a for loop positioned like this:
I've only ever seen for loops positioned at the beginning of lines. Is this usual? How can I know when this is okay? I think I would have tried something like this instead
I'm learning python and have never seen a for loop positioned like this:
Python:
integers = [4, 5, 7]
strings = [str(integer) for integer in integers]
Python:
integers = [4, 5, 7]
strings = range(len(integers))
for i in integers:
strings(i) = [str(i)]