Re: processing the genetic code with python?

2006-03-10 Thread brainy_muppet


>
> I'm writing your name down and this is the last time I'm doing homework
> for you.
>
> James
>
>

Wow, you are really a pretentious asshole. If you don't want to provide
people with help, don't bother. 

And that code's incorrect anyway.

-- 
http://mail.python.org/mailman/listinfo/python-list


Numbers in python

2006-03-10 Thread brainy_muppet
Basically, I have a code with is almost finished but I've having
difficultly with the last stage of the process. I have a program that
gets assigns different words with a different value via looking them up
in a dictionary:

eg if THE is in the writing, it assigns 0.965

 and once the whole passage is read it returns all the numbers in the
format as follows:

['0.965', '1.000', '0.291', '1.000', '0.503']

However, I can't seem to get the program to treat the numbers as
numbers. If I put them in the dictionary as 'THE' = int(0.965) the
program returns 1.0 and if I put 'THE' = float(0.965) it returns
0.9655549 or something similar. Neither of these are right! I
basically need to access each item in the string as a number, because
for my last function I want to multiply them all together by each
other.

I have tried two bits of code for this last bit, but neither are
working (I'm not sure about the first one but the second one should
work I think if I could figure out how to return the values as
numbers):

1st code
value = codons[x] * codons[x+1]
x = (int)
x = 0

print value

x +=2

if (xhttp://mail.python.org/mailman/listinfo/python-list


Re: Numbers in python

2006-03-10 Thread brainy_muppet
'It certainoly does _not_ return 1.0 - it returns 1. And that is all it
can
return for being an integer that has by definition no fractional part.
'

For goodness sake, it was a typo, I'm so sorry!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Numbers in python

2006-03-10 Thread brainy_muppet
'It certainoly does _not_ return 1.0 - it returns 1. And that is all it
can
return for being an integer that has by definition no fractional part.
'

For goodness sake, it was a typo, I'm so sorry!

-- 
http://mail.python.org/mailman/listinfo/python-list