I've started a little challenge on a website, and the first one was about counting different DNA letters. I've done it, but I found my method very brutal. I have a little experience, and I know that hard-coded information is not good. Any way to improve this code?
chaine = "AAAACCCGGT" nA = 0 nT = 0 nG = 0 nC = 0 for i in range(len(chaine)): if chaine[i] == "A": nA = nA + 1 if chaine[i] == "C": nC = nC + 1 print nA, nC