I'm getting this error from the code, "UnboundLocalError: local variable 'lowest' referenced before assignment". Why am I getting this? What does 'referenced before assignment' in this case really mean? Because I think that I assign the variable 'lowest' only after 'scores' variable is defined. Any help would be appreciated.
def main():
scores = get_score()
total = get_total(scores)
lowest -= min(scores)
average = total / (len(scores) - 1)
print('The average, with the lowest score dropped is:', average)
def get_score():
test_scores = []
again = 'y'
while again == 'y':
value = float(input('Enter a test score: '))
test_scores.append(value)
print('Do you want to add another score? ')
again = input('y = yes, anything else = no: ')
print()
return test_scores
def get_total(value_list):
total = 0.0
for num in value_list:
total += num
return total
main()