anonymous
  • anonymous
I want to do that: seq1 = "atgctaaggt" i want to count number of a's for example. I am using python 3.2 and i can't make the count command. Thanks a lot
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
I believe that lesson makes use of find(string, key, position), but if you just want to count letters here is a simple loop: ctr = 0 seq1 = "atgctaaggt" for letter in seq1: if letter == 'a': ctr += 1 print 'There are', ctr, 'a\'s in this sequence'
anonymous
  • anonymous
I tried it and it worked. But this means if i need to count g or t or c's in the same seq1 i need to make different codes. Thanks
anonymous
  • anonymous
So the course example code is all geared to Python 2.x - the instructions say DON'T use 3.x or the examples might not work - you add a layer of complexity to debugging by using 3.x It is probably safe to assume that most of us taking this course are just learning 2.x and don't know what the differences are. paste your code at dpaste.com then post the link here

Looking for something else?

Not the answer you are looking for? Search for more explanations.