,,,
students = [['Kermit Wade', 27] ,['Hattie Schleusner', 67], ['Ben Ball', 5] ,['William Lee', 2]]
def Select(students, threshold):
def Convert(lst):
res = dict()
for sub in lst:
res[tuple(sub[:1])] = tuple(sub[1:])
return res
def get_key(val):
for key, value in Convert(students).items():
if (val,) == value:
return key
s=Convert(students)
def get_key(val):
for key, value in Convert(students).items():
if (val,) == value:
return key
e=[]
for k in range(threshold,100):
if get_key(k) != None:
e.append(get_key(k))
e.append(s.get(get_key(k)))
z=e
new_lst= str(set(z)-set(',() {}, ')
Select(students, 50)
,,,
What is wrong with this code My computer is telling me the error is on 550 where it says select(students,50) But I can’t find the problem
>Solution :
If you look at line: 30 you can see there is a missing parentheses. Replace new_lst = str(set(z) - set(',() {}, ') with new_lst = str(set(z) - set(',() {}, ')).