Tuesday, 6 August 2013

Trying to create a (list or array, not sure) with data I have outputted from a nested for loop

Trying to create a (list or array, not sure) with data I have outputted
from a nested for loop

My nested for loop above end with
print print1,
print print2,
print print3,
print print4
which means i haven't yet appended or made a new data set, as i am a
python beginner I do not know how. My output of data displays as:
Nameone
Nametwoo
5454
62158
Nameoneooo
Nametwoooo
1212
21
Nameoneww
Nametwoww
3455
21332
I'm trying to take the keep the 1st and 2nd lines together, not nessasary,
but then compare the 3rd and 4th lines, the 4th line must be bigger in
order to be true for me, so i only want to output the lines where that
would be true. thus in the above sample code, only the middle 4 lines
would end up outputting
[Nameone: Nametwo, 5454-62158], etc.

No comments:

Post a Comment