On Tue, Jul 29, 2014 at 4:13 PM, 이명교 <[email protected]> wrote:
> inf1 = open('first.txt')
> for line in inf1.readlines():
> list1.append(line)
So far, so good...
> list1 = line[:-1].split('\n')
...but then you do this, which wipes out list1.
> for a in list1:
> if a not in list1:
Even if you hadn't already wiped out list1, this would be a problem.
These two lines essentially say "if a is both in AND not in list1..."
There might be other issues, but fixing those will get you started.
Also: don't be afraid to add print() all over the place so you can
see what's happening!
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor