Re: [Tutor] a little loop

2013-05-27 Thread kartik sundarajan
One way I can suggest is x=0; ham=''; b=['s','p','a','m'] #or, b=('s','p','a','m') > for t in b: > ham=ham+b[x] > print(ham);x+=1 > > > 't' is actually equal to b[x] and its faster then indexed based look-up. so you can rewrite ham = ham + b[x] as ham += t and remove the x inc

[Tutor] Python internals

2013-05-04 Thread kartik sundarajan
Hi, I am trying to learn how Python stores variables in memory. For ex: my_var = 'test' def func(): pass when I type dir() I get ['__builtins__', '__doc__', '__name__', '__package__', 'func', 'help', 'my_var'] are these variables stored in a dict and on calling dir() all the keys are retu

Re: [Tutor] Phyton script for fasta file (seek help)

2013-04-08 Thread kartik sundarajan
My guess is you are using Python version >2.6 where "set" is a built-in. You can fix this by doing the following. 1) Remove "from sets import Set" 2) And replace "alphabet = list(Set(stList))" with "alphabet = list(set(stList))" This should work straight away. P.S Its "Python" not phyton Cheers