beginner question fibonacci

2005-07-17 Thread Joon
>>> # Fibonacci series: ... # the sum of two elements defines the next ... a, b = 0, 1 >>> while b < 10: ... print b ... a, b = b, a+b ... 1 1 2 3 5 8 >>> a, b = 0, 1 >>> while b < 10: print b a = b b = a+b 1 2 4 8 Why a, b = b, a+b isn't a =

Re: beginner question fibonacci

2005-07-17 Thread Joon
Yes, i see. Thank you very much for the fast help! -- http://mail.python.org/mailman/listinfo/python-list

Delete duplicate rows in textfile - except it contains a "{" or "}"

2012-10-10 Thread Joon Ki Choi
ould someone point me out to adding this condition? Thanks in advance, Joon -- http://mail.python.org/mailman/listinfo/python-list

Re: Delete duplicate rows in textfile - except it contains a "{" or "}"

2012-10-10 Thread Joon Ki Choi
lines_seen = set() # holds lines already seen outfile = open("literatur_clean.txt", "w") for line in open("literatur_dupl.txt", "r"): if ('{' in line or '}' in line) or line not in lines_seen: outfile.write(line) lines_seen.add(line) outfile.close() -- http://mail.python.org/ma