Thursday, April 2, 2009

Hint on EX1

Dear CHE210D class:

In working on exercise 1, there are many ways to make your code very short using Python's string functions and list expressions & objects. Your final code should actually be quite short. For example, to test whether or not a given amino acid name is hydrophobic, you could use something like the following
>>> Phobics = ["ALA", ... , "TRP"]
>>> s = "ALA"
>>> s in Phobics
True
>>> s = "ARG"
>>> s in Phobics
False
-MSS

No comments: