def METHOD_NAME(self):
    if self.type in range(len(self.percentlist)):
        i = self.type
    else:
        i = 0
    try:
        value = self.percentlist[i]
    except IndexError:
        value = 0
    return value