Given: A protein string P of length at most 1000 aa.
Return: The total weight of P. Consult the monoisotopic mass table.
Return: The total weight of P. Consult the monoisotopic mass table.
def mass_table(): mt = {} mt['A'] = 71.03711
mt['C'] = 103.00919
mt['D'] = 115.02694
mt['E'] = 129.04259
mt['F'] = 147.06841
mt['G'] = 57.02146
mt['H'] = 137.05891
mt['I'] = 113.08406
mt['K'] = 128.09496
mt['L'] = 113.08406
mt['M'] = 131.04049
mt['N'] = 114.04293
mt['P'] = 97.05276
mt['Q'] = 128.05858
mt['R'] = 156.10111
mt['S'] = 87.03203
mt['T'] = 101.04768
mt['V'] = 99.06841
mt['W'] = 186.07931
mt['Y'] = 163.06333
return mt protein = input() mt = mass_table() mass = 0
for aa in protein: mass += mt[aa] print(round(mass,3))
Комментариев нет:
Отправить комментарий