Question: Getting this error for the below code - get _ minimums ( - 1 , 'Pattern',False,False,True,minimums ) returned [ 5 0 0 . 0 ,

Getting this error for the below code - get_minimums(-1,'Pattern',False,False,True,minimums) returned [500.0,0.75,30.0,20.0], but should have returned None.
def get_minimums(cert, area, instructed, vfr, daytime, minimums):
matching_rows =[]
#find matching rows
for row in minimums:
# Check if the row matches the given conditions
if (cert >= PILOT_CERTIFIED and row[0]== 'Certified') or \
(cert == PILOT_50_HOURS and row[0]=='50 Hours') or \
(instructed and row[0]== 'Dual') or \
(row[2]== area) or \
(vfr and row[1]=='VMC') or \
(not vfr and row[1]== 'IMC') or \
(daytime and row[3]== 'Day') or \
(not daytime and row[3]== 'Night'):
matching_rows.append(row)
#None for no matching rows
if not matching_rows:
return None
ceiling_index =4
visibility_index =5
wind_index =6
crosswind_index =7
best_ceiling = get_best_value(matching_rows, ceiling_index, maximum=False)
best_visibility = get_best_value(matching_rows, visibility_index, maximum=False)
best_wind = get_best_value(matching_rows, wind_index, maximum=True)
best_crosswind = get_best_value(matching_rows, crosswind_index, maximum=True)
return [best_ceiling, best_visibility, best_wind, best_crosswind]

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 Programming Questions!