Harvard:Biophysics 101/2007/02/06: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
Line 11: Line 11:
**If you have programming experience, try to do the exercise on your own
**If you have programming experience, try to do the exercise on your own
**If you have no idea where to start, you can look at this [[Harvard:Biophysics_101/2007/02/06:coinflip.py|template]]
**If you have no idea where to start, you can look at this [[Harvard:Biophysics_101/2007/02/06:coinflip.py|template]]
*General
**Try to read the [http://docs.python.org/tut/tut.html Python tutorial].  Specifically, chapters [http://docs.python.org/tut/node5.html 3] and [http://docs.python.org/tut/node6.html 4].
**The <code>range()</code> Function is covered in [http://docs.python.org/tut/node6.html#SECTION006300000000000000000 chapter 4]
**[http://docs.python.org/tut/node7.html#SECTION007140000000000000000 List comprehensions] and [http://docs.python.org/tut/node7.html#SECTION007600000000000000000 loops] are covered in [http://docs.python.org/tut/node7.html chapte 5]


</div>
</div>

Revision as of 14:27, 6 February 2007

Biophysics 101: Genomics, Computing, and Economics

Home        People        Schedule        Project        Python        Help       

Tasks to complete by Feb 8

  • Complete Feb 1 tasks
  • Write a python script that generates 10,000 strings of 10 random coinflips (H or T) and outputs the tally of continguous (overlapping) stretches of 2, 3, 4, 5, 6, 7, 8, 9, and 10 H's or T's in that set of 10,000 10-mers.
  • Post your code to your personal calendar entry for Feb 8, along with the output when it is run.
  • Hints
    • You may find it useful to read about the random module, specifically "choice()"
    • You can reuse a modified version of substring the matching "Method 2" from the first assignment
    • If you have programming experience, try to do the exercise on your own
    • If you have no idea where to start, you can look at this template
  • General