On Sat, Sep 17, 2011 at 9:56 AM, Ananya Sharma <[email protected]> wrote:
[...]
Could you explain the logic that you are trying to use in the code
below, because it is not making much sense. Also, is this a
homework problem?
> *Script-*
> *
> *
> f1=open('fileA','r')
> f2=open('fileB','r')
> a=""
> b=""
> for n in f1:
> while not b.startswith(n):
> b=f2.readline()
> if len(a)>0:
> print a
a is always "" above, so len(a) is always zero.
> b=""
> while not b.startswith(">"):
> a=a+f2.readline()+"__"
[...]
You just set b to "", so the if conditional is never entered.
Regards,
Gora
_______________________________________________
BangPypers mailing list
[email protected]
http://mail.python.org/mailman/listinfo/bangpypers