473,395 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

not a big deal or anything, but, curiously:

following this tutorial, I copied and pasted:

from string import *

cds = """atgagtgaacgtctgagcattaccccgctggggccgtatatcggcgc acaaa
tttcgggtgccgacctgacgcgcccgttaagcgataatcagtttgaacag ctttaccatgcggtg
ctgcgccatcaggtggtgtttctacgcgatcaagctattacgccgcagca gcaacgcgcgctggc
ccagcgttttggcgaattgcatattcaccctgtttacccgcatgccgaag gggttgacgagatca
tcgtgctggatacccataacgataatccgccagataacgacaactggcat accgatgtgacattt
attgaaacgccacccgcaggggcgattctggcagctaaagagttaccttc gaccggcggtgatac
gctctggaccagcggtattgcggcctatgaggcgctctctgttcccttcc gccagctgctgagtg
ggctgcgtgcggagcatgatttccgtaaatcgttcccggaatacaaatac cgcaaaaccgaggag
gaacatcaacgctggcgcgaggcggtcgcgaaaaacccgccgttgctaca tccggtggtgcgaac
gcatccggtgagcggtaaacaggcgctgtttgtgaatgaaggctttacta cgcgaattgttgatg
tgagcgagaaagagagcgaagccttgttaagttttttgtttgcccatatc accaaaccggagttt
caggtgcgctggcgctggcaaccaaatgatattgcgatttgggataaccg cgtgacccagcacta
tgccaatgccgattacctgccacagcgacggataatgcatcgggcgacga tccttggggataaac
cgttttatcgggcggggtaa""".replace("\n","")

gc = float(count(cds, 'g') + count(cds, 'c'))/ len(cds)

print gc

-fin-

which should yield: 0.54460093896713613..

but when I ran it I got: 0.544600938967

looking now I see it's truncating after a certain number of decimal
places. any ideas why?
Dec 13 '06 #1
0 736

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Alex Shi | last post by:
Any good idea or a reference link to deal with search engine for php web pages? Thanks in advance! Alex
21
by: Franco Gustavo | last post by:
Hi, Please help me to understand this, because I don't see what I'm missing. I was reading a lot of examples on Internet that explain that C# doesn't implement multiple inheritance it...
14
by: John Harrison | last post by:
The following code does not compile template <class Derived> struct X { typedef typename Derived::type type; }; struct Y : public X<Y> {
15
by: iuweriur | last post by:
A few questions on the curiously recurring template pattern: This page: http://c2.com/cgi/wiki?CuriouslyRecurringTemplate this part: template<typename T> struct ArithmeticType { T operator...
4
by: Martin MacRobert | last post by:
Hi Gang, The following code does not compile, but I can't figure out why. The compiler complains that the CuriouslyDerivedType (CRDerived) does not publish the "value_type", yet in fact the class...
48
by: Frederick Gotham | last post by:
The "toupper" function takes an int as an argument. That's not too irrational given that a character literal is of type "int" in C. (Although why it isn't of type "char" escapes me... ) The...
4
by: AndrewD | last post by:
Hey C++ folks, I created this today, just for fun. You can make object allocation for any class around 6 times faster, simply by doing the following. class MyClass : public...
4
by: chsalvia | last post by:
The "Curiously Recurring Template Pattern" (CRTP) recently caught my attention as a nice trick which allows static polymorphism. In other words, it lets you build extensible classes without the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.