Question: Python error editing def largest_value(type_list, value_list, label): # Find the car with the highest of the value passed # print out the results as shown

Python error editing

Python error editing def largest_value(type_list, value_list, label): # Find the car with

def largest_value(type_list, value_list, label): # Find the car with the highest of the value passed # print out the results as shown above in the blue section v = 0 #TODO - find the maximum value and save to a variable for i in range (len(value_list)): v.append(value_list[i]) if(value_list[i] > m): m = value(list[i]) i = 0 #TODO - print out the output as shown above print(type_list[p], 'has most', label, 'of', m) # temporary - can delete later largest_value(['Carl', 'Car2', 'Car3'], [30,40,25), 'MPG') UnboundLocalError Traceback (most recent call last) in 1 # temporary - can delete later ----> 2 largest_value(['Carl', 'Car2', 'Car3'], [30,40,25], 'MPG') in largest_value(type_list, value_list, label) 7 for i in range (len (value_list)): 8 v.append(value_list[i]) ----> 9 if(value_list[i] > m): 10 m = value (list[i]) 11 i = 0 UnboundLocalError: local variable 'm' referenced before assignment

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!