def calcDiff(s, R): global s_s, i, x, weights s_s = set() weights = [] for i in range(1, len(s)): weights.append(getIsotopicWeight(s[:i])) weights.append(getIsotopicWeight(s[-i:])) weights.append(getIsotopicWeight(s)) diff = mDiff(weights, R) max, max_key = getMaxMultiplicity(diff) return max
from python.util import getIsotopicWeight protein = input() print(getIsotopicWeight(protein))