Aug-25-2019, 08:15 AM
Hey.. I am trying to calculate protein weight using dictionary where weight is given for each amino acid
As and input I am giving = AALI which should give 440 weight
But I am getting an error that the dictionary is not callable
What I am doing wrong??
prot_seq = input('please write the amino acid sequence = ')
prot_weight = {'A':89, 'V':117, 'L':131, 'I':131, 'P':115,
'F':165, 'W':204, 'M':149, 'G':75, 'S':105,
'C':121, 'T':119, 'Y':181, 'N':132, 'Q':146,
'D':133, 'E':147, 'K':146, 'R':174, 'H':155}
for aa in prot_seq:
weight=sum(prot_weight[aa])
print(weight)
As and input I am giving = AALI which should give 440 weight
But I am getting an error that the dictionary is not callable
What I am doing wrong??
prot_seq = input('please write the amino acid sequence = ')
prot_weight = {'A':89, 'V':117, 'L':131, 'I':131, 'P':115,
'F':165, 'W':204, 'M':149, 'G':75, 'S':105,
'C':121, 'T':119, 'Y':181, 'N':132, 'Q':146,
'D':133, 'E':147, 'K':146, 'R':174, 'H':155}
for aa in prot_seq:
weight=sum(prot_weight[aa])
print(weight)