id
stringlengths 35
39
| content
stringlengths 44
3.85k
| max_stars_repo_path
stringlengths 52
57
|
|---|---|---|
refactory_data_question_4_wrong_4_261
|
def sort_age(lst):
lst.sort(key=lambda x:x[1],reverse=True)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_261.py
|
refactory_data_question_4_wrong_4_294
|
def sort_age(lst):
sort=[]
while lst:
biggest=lst[0][1]
for i in lst:
if i[1]>=biggest:
biggest=i[1]
lst.remove(i)
sort.append(i)
return sort# Fill in your code here
|
./refactory/data/question_4/code/wrong/wrong_4_294.py
|
refactory_data_question_4_wrong_4_302
|
def sort_age(lst):
for i in range(len(lst)-1):
for j in range(len(lst)-i):
if lst[j][1] < lst[j+1][1]:
lst[j][1],lst[j+1][1] = lst[j+1][1],lst[j][1]
else:
continue
return lst
pass
|
./refactory/data/question_4/code/wrong/wrong_4_302.py
|
refactory_data_question_4_wrong_4_129
|
def sort_age(lst):
people = []
while lst:
i = lst[0]
for a in lst:
if a[1] >= i[1] :
i = a
lst.remove(i)
final.append(i)
return final
|
./refactory/data/question_4/code/wrong/wrong_4_129.py
|
refactory_data_question_4_wrong_4_107
|
def sort_age(lst):
smallest = lst[0][1]
sort = []
while lst:
for k in lst:
if k[1] < smallest:
smallest = k[1]
smallest_tuple = k
lst.remove(k)
sort.append(k)
|
./refactory/data/question_4/code/wrong/wrong_4_107.py
|
refactory_data_question_4_wrong_4_335
|
def sort_age(lst):
if len(lst)==1:
return lst
else:
temp=lst[0][1]
for i in range(len(lst)):
if lst[i][1]<temp:
temp=lst[i][1]
count=i
result=[lst[count],]
pop=lst.pop(count)
return result+sort_age(lst)
# Fill in your code here
pass
|
./refactory/data/question_4/code/wrong/wrong_4_335.py
|
refactory_data_question_4_wrong_4_255
|
def sort_age(lst):
newlst = []
while lst:
i = lst[0]
for element in lst:
if element[1] >= i[1]:
i = n
lst.remove(i)
final.append(i)
return newlst
|
./refactory/data/question_4/code/wrong/wrong_4_255.py
|
refactory_data_question_4_wrong_4_328
|
def sort_age(lst):
# Fill in your code here
sorted = []
while lst:
oldest = lst[0]
for i in range(len(lst)):
if lst[i][1] > oldest[1]:
oldest = lst[i]
sorted.append(lst.pop(i))
return sorted
|
./refactory/data/question_4/code/wrong/wrong_4_328.py
|
refactory_data_question_4_wrong_4_203
|
def sort_age(lst):
sort = []
while len(lst) > 0:
smallest = lst[0]
for i in lst:
if i[1] < smallest[1]:
smallest[1] = i[1]
lst.remove(smallest)
sort.append(smallest)
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_203.py
|
refactory_data_question_4_wrong_4_314
|
def sort_age(lst):
lst.sort(key=lambda x: x[1])
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_314.py
|
refactory_data_question_4_wrong_4_307
|
def sort_age(lst):
sort =[]
while lst:
smallest = lst[0]
for i in lst:
if i< smallest:
smallest = i
lst.remove(smallest)
sort.append(smallest)
return sort
pass
|
./refactory/data/question_4/code/wrong/wrong_4_307.py
|
refactory_data_question_4_wrong_4_278
|
def sort_age(lst):
for i in range(len(lst)-1):
if lst[i+1][1] < lst[i][1]:
x = lst[i]
lst[i] = lst[i+1]
lst[i+1] = x
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_278.py
|
refactory_data_question_4_wrong_4_286
|
def sort_age(lst):
return lst.sort(key = lambda x: x[1], reverse = True)
|
./refactory/data/question_4/code/wrong/wrong_4_286.py
|
refactory_data_question_4_wrong_4_039
|
def sort_age(lst):
if lst==[]:
return []
sort=[]
while lst:
largest = lst[0]
for i in lst:
if i > largest:
largest = i
lst.remove(largest)
sort.append(largest)
return sort
pass
|
./refactory/data/question_4/code/wrong/wrong_4_039.py
|
refactory_data_question_4_wrong_4_338
|
def sort_age(lst):
new_lst=[lst[0],]
if lst==[]:
return []
for x in lst[1:]:
if x[1] > new_lst[-1][1]:
new_lst += [x,]
else:
count=0
while count<len(new_lst):
if x[1] > new_lst[count][1]:
count+=1
continue
else:
new_lst = new_lst[0:count]+[x,]+new_lst[count:]
break
return new_lst[::-1]
|
./refactory/data/question_4/code/wrong/wrong_4_338.py
|
refactory_data_question_4_wrong_4_215
|
def sort_age(lst):
lst.sort(key=lambda x: x[1])
lst.reverse()
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_215.py
|
refactory_data_question_4_wrong_4_342
|
def sort_age(lst):
lst.sort(key=lambda x: x[1], reverse=True)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_342.py
|
refactory_data_question_4_wrong_4_027
|
def sort_age(lst):
sort = []
while lst:
biggest = lst[1]
for element in lst:
if element > biggest:
biggest = element
lst.remove(biggest)
sort.append(biggest)
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_027.py
|
refactory_data_question_4_wrong_4_150
|
def sort_age(lst):
i=0
while i+1<len(lst):
if lst[i][1]<lst[i+1][1]:
lst.extend([lst[i]])
lst.pop([lst[i]])
else:
i+=1
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_150.py
|
refactory_data_question_4_wrong_4_252
|
def sort_age(lst):
list1 = []
while lst:
biggest = lst[0]
for i in range(1,len(lst)+1):
if lst[i][1] > biggest[1]:
biggest = lst[i][1]
lst.remove(biggest)
list1.append(biggest)
return list1
|
./refactory/data/question_4/code/wrong/wrong_4_252.py
|
refactory_data_question_4_wrong_4_299
|
def sort_age(lst):
return lst.sort(key=lambda x:x[1])
|
./refactory/data/question_4/code/wrong/wrong_4_299.py
|
refactory_data_question_4_wrong_4_214
|
def sort_age(lst):
lst.sort(key=lambda x: x[1])
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_214.py
|
refactory_data_question_4_wrong_4_044
|
def sort_age(lst):
lst.sort(key = lambda x: x[1], reverse = True)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_044.py
|
refactory_data_question_4_wrong_4_133
|
def sort_age(lst):
while lst:
smallest = lst[0]
for e in lst[1:]:
if e[1]<smallest:
smallest = e[1]
lst.remove(smallest)
lst.append(smallest)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_133.py
|
refactory_data_question_4_wrong_4_034
|
def sort_age(lst):
a=lst
sort=[]
while a:
smallest=a[0]
for element in a:
if element[1]<smallest[1]:
smallest=element
a.remove(smallest)
sort.append(smallest)
sort.reverse()
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_034.py
|
refactory_data_question_4_wrong_4_246
|
def sort_age(lst):
list1 = []
smallest = lst[0][1]
s = (lst[0],)
for j in range(1,len(lst)):
for i in range(1,len(lst)-1):
if lst[i][1] < smallest:
smallest = lst[i][1]
s = (lst[i],)
list1 += s
return list1
|
./refactory/data/question_4/code/wrong/wrong_4_246.py
|
refactory_data_question_4_wrong_4_349
|
def sort_age(lst):
current=0
tup=[]
for i in lst:
if i[1]>current:
tup.append(i)
else:
i.append(tup)
return tup
|
./refactory/data/question_4/code/wrong/wrong_4_349.py
|
refactory_data_question_4_wrong_4_092
|
def sort_age(lst):
answer = []
for i in range(0,len(lst),-1):
biggest = lst[i]
for a in range(i):
if lst[a][1] > biggest[1]:
biggest = lst[a]
answer += biggest
return answer
|
./refactory/data/question_4/code/wrong/wrong_4_092.py
|
refactory_data_question_4_wrong_4_072
|
def sort_age(lst):
while lst:
oldest = lst[0]
for i in lst[1:]:
if i[1] > oldest[1]:
oldest = i
lst.remove(oldest)
sort.append(oldest)
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_072.py
|
refactory_data_question_4_wrong_4_322
|
def sort_age(lst):
lst.sort(key=lambda x: x[1], reverse=True)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_322.py
|
refactory_data_question_4_wrong_4_179
|
def sort_age(lst):
a = lst
sort = []
while a:
largest = a[0][1]
for item in a:
if item[1] >largest:
largest = item
a.remove(largest)
sort.append(largest)
print(sort)# Fill in your code here
|
./refactory/data/question_4/code/wrong/wrong_4_179.py
|
refactory_data_question_4_wrong_4_106
|
def sort_age(lst):
smallest = lst[0][1]
sort = []
while lst:
for k in lst:
if k[1] < smallest:
smallest = k[1]
a.remove(smallest)
sort.append(smallest)
|
./refactory/data/question_4/code/wrong/wrong_4_106.py
|
refactory_data_question_4_wrong_4_119
|
def sort_age(lst):
first = lst[0][1]
result = []
for x in lst[1:]:
if x[1] > first:
result = (first,) + (x[1],)
else:
result = (x[1],) + (first,)
pass
|
./refactory/data/question_4/code/wrong/wrong_4_119.py
|
refactory_data_question_4_wrong_4_300
|
def sort_age(lst):
lst.sort(key=lambda x:x[1])
lst.reverse()
print(lst)
|
./refactory/data/question_4/code/wrong/wrong_4_300.py
|
refactory_data_question_4_wrong_4_264
|
def sort_age(lst):
lst.sort(key= lambda x: x[1], reverse=True)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_264.py
|
refactory_data_question_4_wrong_4_023
|
def sort_age(lst):
sort = []
while lsst:
biggest = a[0]
for element in a:
if element > biggest:
smallest = element
a.remove(biggest)
sort.append(biggest)
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_023.py
|
refactory_data_question_4_wrong_4_221
|
def sort_age(lst):
lst.sort(key = lambda x: x[1], reverse = True)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_221.py
|
refactory_data_question_4_wrong_4_060
|
def sort_age(lst):
sort = []
while lst:
biggest = lst[0]
for element in lst:
if element > biggest:
biggest = element
lst.remove(biggest)
sort.append(biggest)
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_060.py
|
refactory_data_question_4_wrong_4_012
|
def sort_age(lst):
old_lst = lst
new_lst = []
while old_lst:
largest = old_lst[0]
for i in lst:
if i > largest:
largest = i
old_lst.remove(largest)
new_lst.append(largest)
return new_lst
|
./refactory/data/question_4/code/wrong/wrong_4_012.py
|
refactory_data_question_4_wrong_4_297
|
def sort_age(lst):
ages = []
output = []
for item in lst:
ages.append(item[1])
for item in lst:
age = max(ages)
if age == item[1]:
output.append(item)
ages.remove(age)
return output
|
./refactory/data/question_4/code/wrong/wrong_4_297.py
|
refactory_data_question_4_wrong_4_048
|
def sort_age(lst):
output = []
while lst:
smallest = lst[0]
for i in lst:
if i[1] < smallest[1]:
smallest = i
lst.remove(smallest)
output.append(smallest)
return output
|
./refactory/data/question_4/code/wrong/wrong_4_048.py
|
refactory_data_question_4_wrong_4_131
|
def sort(lst):
for i in range(len(lst)-1):
if lst[i][1] > lst[i+1][1]:
temp = lst[i]
del lst[i]
lst += [temp]
else:
continue
return lst
def sort_age(lst):
oldlist = tuple(lst)
if tuple(sort(lst)) == oldlist:
return lst
else:
sort(lst)
return sort_age(lst)
|
./refactory/data/question_4/code/wrong/wrong_4_131.py
|
refactory_data_question_4_wrong_4_301
|
def sort_age(lst):
lst.sort(key=lambda x:x[1])
lst.reverse()
print(lst)
|
./refactory/data/question_4/code/wrong/wrong_4_301.py
|
refactory_data_question_4_wrong_4_263
|
def sort_age(lst):
# Fill in your code here
return lst.sort(key=lambda x: x[1])
|
./refactory/data/question_4/code/wrong/wrong_4_263.py
|
refactory_data_question_4_wrong_4_103
|
def sort_age(lst):
largest = lst[0][1]
sort1 = []
for i in lst:
if i[1] > largest:
largest = i[1]
sort1.append(i)
return sort1
|
./refactory/data/question_4/code/wrong/wrong_4_103.py
|
refactory_data_question_4_wrong_4_303
|
def sort_age(lst):
lst.sort(key=lambda x:x[1])
lst.reverse()
print(lst)
|
./refactory/data/question_4/code/wrong/wrong_4_303.py
|
refactory_data_question_4_wrong_4_173
|
def sort_age(lst):
sort=[]
while lst:
smallest = lst[0][1]
for i in range (len(lst)):
if lst[i][1] < smallest:
smallest = lst[i][1]
a.remove(smallest)
sort.append(smallest)
sort.reverse(smallest)
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_173.py
|
refactory_data_question_4_wrong_4_292
|
def sort_age(lst):
sort=[]
while lst:
biggest=lst[0][1]
for i in lst:
if i[1]>biggest:
biggest=i[1]
lst.remove(i)
sort.append(i)
return sort# Fill in your code here
|
./refactory/data/question_4/code/wrong/wrong_4_292.py
|
refactory_data_question_4_wrong_4_010
|
def sort_age(lst):
for i in range(0,len(lst)):
this=lst[0]
for j in range(1,len(lst)+1):
a=len(lst)-j
if lst[a][1]>this[1]:
lst=lst[1:a+1]+[this]+lst[a+1:]
break
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_010.py
|
refactory_data_question_4_wrong_4_293
|
def sort_age(lst):
sort=[]
while lst:
biggest=0
for i in lst:
if i[1]>biggest:
biggest=i[1]
lst.remove(i)
sort.append(i)
return sort# Fill in your code here
|
./refactory/data/question_4/code/wrong/wrong_4_293.py
|
refactory_data_question_4_wrong_4_197
|
def sort_age(lst):
new_lst = []
for i in range(len(lst)):
if lst[i][1]< lst[i+1][1]:
new_lst.append(lst[i])
lst.reverse()
return lst
pass
|
./refactory/data/question_4/code/wrong/wrong_4_197.py
|
refactory_data_question_4_wrong_4_091
|
def sort_age(lst):
holder=[]
if lst==[]:
return []
for x in lst:
if holder==[]:
holder=x
elif x[1]>holder[1]:
holder=x
return [holder]+sort_age(lst.remove(holder))
|
./refactory/data/question_4/code/wrong/wrong_4_091.py
|
refactory_data_question_4_wrong_4_236
|
def sort_age(lst):
def age(i):
return i[1]
def position(seq, ele):
n = len(seq)
for i in range(n):
if seq[i] == ele:
return i
def largest_age(seq):
largest = age(seq[0])
largest_pos = 0
for i in seq:
if age(i) > largest:
largest = age(i)
largest_pos = position(seq,i)
return seq[largest_pos]
n = len(lst)
if n ==0:
return []
elif n ==1:
return lst
else:
return [largest_age(lst)]+[sort_age(lst[1:])]
# Fill in your code here
pass
|
./refactory/data/question_4/code/wrong/wrong_4_236.py
|
refactory_data_question_4_wrong_4_089
|
def sort_age(lst):
holder=[]
if lst==[]:
return []
for x in lst:
if holder==[]:
holder=x
elif x[1]>holder[1]:
holder=x
return holder+sort_age(lst[1:])
|
./refactory/data/question_4/code/wrong/wrong_4_089.py
|
refactory_data_question_4_wrong_4_333
|
def sort_age(lst):
for i in range(1,len(lst)):
while lst[i][1]<lst[i-1][1]:
lst.pop(lst[i])
lst.insert(lst[i],i-1)# Fill in your code here
return lst.reverse()
|
./refactory/data/question_4/code/wrong/wrong_4_333.py
|
refactory_data_question_4_wrong_4_151
|
def sort_age(lst):
new = []
while lst:
small = lst[0][1]
name =lst[0][0]
for ele in lst:
if ele[1]<small:
small = ele[1]
name = ele[0]
new.append((name,small))
lst.remove((name,small))
return new.reverse
|
./refactory/data/question_4/code/wrong/wrong_4_151.py
|
refactory_data_question_4_wrong_4_347
|
def sort_age(lst):
current=0
tup=()
for i in lst:
if i[1]>current:
tup+=tuple(i)
current=i[1]
else:
tup=tuple(i)+tup
return list(tup)
|
./refactory/data/question_4/code/wrong/wrong_4_347.py
|
refactory_data_question_4_wrong_4_258
|
def sort_age(lst):
res = []
age_list= []
while lst:
for i in range(len(lst)):
age_list = age_list+ [lst[i][1]]
for i in lst:
if max(age_list) == i[1]:
res= res + [i]
else:
res = res
lst.remove(i)
age_list.remove(i[1])
return res
|
./refactory/data/question_4/code/wrong/wrong_4_258.py
|
refactory_data_question_4_wrong_4_219
|
def sort_age(lst):
new_lst = []
for i in range(len(lst)):
max_num = max(lst)
lst.remove(max_num)
new_lst.append(max_num)
return new_lst
|
./refactory/data/question_4/code/wrong/wrong_4_219.py
|
refactory_data_question_4_wrong_4_120
|
def sort_age(lst):
first = lst[0][1]
result = []
for x in lst[1:]:
if x[1] > first:
result = (first,) + (x[1],)
else:
result = (x[1],) + (first,)
return result
pass
|
./refactory/data/question_4/code/wrong/wrong_4_120.py
|
refactory_data_question_4_wrong_4_279
|
def sort_age(lst):
for i in range(len(lst)-1):
if lst[i+1][1] > lst[i][1]:
x = lst[i]
lst[i] = lst[i+1]
lst[i+1] = x
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_279.py
|
refactory_data_question_4_wrong_4_056
|
def sort_age(lst):
# Fill in your code here
new_lst = []
while lst:
for i in range(len(lst)):
oldest = lst[0]
if lst[i][1] > oldest[1]:
oldest = lst[i]
lst.remove(oldest)
new_lst.append(oldest)
return new_lst
|
./refactory/data/question_4/code/wrong/wrong_4_056.py
|
refactory_data_question_4_wrong_4_190
|
def sort_age(lst):
sort = [ ]
while lst: # a is not [ ]
biggest = lst[0]
for element in lst:
if element[1] > biggest[1]:
biggest = element
lst.remove(biggest)
sort.append(biggest)
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_190.py
|
refactory_data_question_4_wrong_4_067
|
def sort_age(lst):
return lst.sort(key = lambda x: x[1])
|
./refactory/data/question_4/code/wrong/wrong_4_067.py
|
refactory_data_question_4_wrong_4_357
|
def sort_age(lst):
# Fill in your code here
newlst=[]
while lst:
maximum = lst[0][1]
for i in lst:
if i[1]>maximum:
maximum = i[1]
newlst.append(i)
lst.remove(i)
return newlst
|
./refactory/data/question_4/code/wrong/wrong_4_357.py
|
refactory_data_question_4_wrong_4_156
|
def sort_age(lst):
new = []
while lst:
curr = lst[0]
for i in lst:
if i[1]<curr[1]:
curr = i
lst.remove(i)
new.append(i)
return new
|
./refactory/data/question_4/code/wrong/wrong_4_156.py
|
refactory_data_question_4_wrong_4_038
|
def sort_age(lst):
lst.sort(key=lambda x: x[1], reverse=True)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_038.py
|
refactory_data_question_4_wrong_4_350
|
def sort_age(lst):
# Fill in your code here
result=[]
for i in lst:
result+=[i[::-1],]
result.sort()
result.reverse()
ans=[]
for i in result:
ans+=[i[::-1],]
return ans
|
./refactory/data/question_4/code/wrong/wrong_4_350.py
|
refactory_data_question_4_wrong_4_230
|
def sort_age(lst):
oldest = lst[0][1]
for item in lst:
if item[1] > oldest:
oldest = item[1]
lst.remove(item)
lst = [item,] + lst
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_230.py
|
refactory_data_question_4_wrong_4_186
|
def sort_age(lst):
a = lst
sort = []
while a:
largest = a[0]
for item in a:
if item[1] >largest[1]:
largest = item
a.remove(largest)
sort.append(largest)
print(sort)# Fill in your code here
|
./refactory/data/question_4/code/wrong/wrong_4_186.py
|
refactory_data_question_4_wrong_4_126
|
def sort_age(lst):
sort = []
while lst:
oldest = lst[0]
for i in lst:
if i[1] > oldest[1]:
oldest = i
lst.remove(biggest)
sort.append(biggest)
return sort
# Fill in your code here
|
./refactory/data/question_4/code/wrong/wrong_4_126.py
|
refactory_data_question_4_wrong_4_266
|
def sort_age(lst):
while lst:
smallest = lst[0][1]
for x in lst:
if x[1] < smallest:
smallest = x
lst.remove(smallest)
sort.append(smallest)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_266.py
|
refactory_data_question_4_wrong_4_259
|
def sort_age(lst):
lst.sort(key = lambda x: x[1], reverse = True)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_259.py
|
refactory_data_question_4_wrong_4_271
|
def sort_age(lst):
if len(lst) < 2:
return lst
midpoint = len(lst) // 2
left = sort_age(lst[:midpoint])
right = sort_age(lst[midpoint:])
new_list = []
while left and right:
if left[0][1] < right[0][1]:
new_list.append(right.pop(0))
else:
new_list.append(left.pop(0))
new_list.extend(left)
new_list.extend(right)
return new_list
|
./refactory/data/question_4/code/wrong/wrong_4_271.py
|
refactory_data_question_4_wrong_4_095
|
def sort_age(lst):
lst.sort(lambda x: x[1])
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_095.py
|
refactory_data_question_4_wrong_4_171
|
def sort_age(lst):
lst.sort(lambda x: x[1])
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_171.py
|
refactory_data_question_4_wrong_4_240
|
def sort_age(lst):
lst.sort(key=lambda x: x[1])
lst.reverse()
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_240.py
|
refactory_data_question_4_wrong_4_002
|
def sort_age(lst):
sort = []
while lst:
oldest = lst[0]
for person in lst:
if person > oldest:
person = oldest
a.remove(smallest)
sort.append(smallest)
print(a)
|
./refactory/data/question_4/code/wrong/wrong_4_002.py
|
refactory_data_question_4_wrong_4_015
|
def sort_age(lst):
sort = []
while lst:
smallest = lst[0]
for element in lst:
if element < smallest:
smallest = element
a.remove(smallest)
sort.append(smallest)
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_015.py
|
refactory_data_question_4_wrong_4_159
|
def sort_age(lst):
i=0
while i+1<len(lst):
if lst[i][1]<lst[i+1][1]:
lst.extend([lst[i]])
del lst[i]
else:
i+=1
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_159.py
|
refactory_data_question_4_wrong_4_169
|
def sort_age(lst):
sorted_lst = []
while lst:
smallest = lst[0]
for i in lst:
if i[1] < smallest[1]:
smallest = i
lst.remove(smallest)
sorted_lst.append(smallest)
return sorted_lst
|
./refactory/data/question_4/code/wrong/wrong_4_169.py
|
refactory_data_question_4_wrong_4_222
|
def sort_age(lst):
n = len(lst)
result = []
while n != 0:
test = []
for counter in range(n):
test.append(lst[counter][1])
first = max(test)
for counter in range(n):
if lst[counter][1] == first:
result.append(lst.pop(counter))
n = len(lst)
return result
|
./refactory/data/question_4/code/wrong/wrong_4_222.py
|
refactory_data_question_4_wrong_4_084
|
def sort_age(lst):
new_lst = []
while lst:
oldest = lst [0]
for i in range(len(lst)):
if lst[i][1] > oldest[1]:
oldest = lst[i]
lst.remove(oldest)
new_lst.append(oldest)
print(new_lst)
|
./refactory/data/question_4/code/wrong/wrong_4_084.py
|
refactory_data_question_4_wrong_4_009
|
def sort_age(lst):
for i in range(0,len(lst)):
this=lst[i]
for j in range(0,len(lst)):
if lst[j][1]<this[1]:
del lst[i]
lst=lst[0:j]+[this]+lst[j:]
break
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_009.py
|
refactory_data_question_4_wrong_4_025
|
def sort_age(lst):
sort = []
while lst:
biggest = lst[0]
for element in lst:
if element > biggest:
smallest = element
lst.remove(biggest)
sort.append(biggest)
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_025.py
|
refactory_data_question_4_wrong_4_331
|
def sort_age(lst):
sort = []
while lst:
biggest = lst[0]
for i in lst:
if i[1] > biggest[1]:
biggesr - i
lst.remove(biggest)
sort.append(biggest)
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_331.py
|
refactory_data_question_4_wrong_4_265
|
def sort_age(lst):
for i in range(len(lst)-1):
for a in range(i+1, len(lst)):
if lst[i][1] < lst[a][1]:
lst[i]= lst[a]
lst[a]= lst[i]
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_265.py
|
refactory_data_question_4_wrong_4_356
|
def sort_age(lst):
# Fill in your code here
newlst=[]
while lst:
maximum = lst[0][1]
for i in lst:
if i[1]>maximum:
maximum = i[1]
newlst.append(i)
lst.remove(i)
return newlst
|
./refactory/data/question_4/code/wrong/wrong_4_356.py
|
refactory_data_question_4_wrong_4_085
|
def sort_age(lst):
new_lst = []
while lst:
oldest = lst [0]
for i in range(len(lst)):
if lst[i][1] > oldest[1]:
oldest = lst[i]
lst.remove(oldest)
new_lst.append(oldest)
print(new_lst)
|
./refactory/data/question_4/code/wrong/wrong_4_085.py
|
refactory_data_question_4_wrong_4_267
|
def sort_age(lst):
# Fill in your code here
sorted_list = []
while a:
oldest = lst[0]
for element in lst:
if element[1] > oldest:
oldest = element[1]
lst.remove(oldest)
sorted_list.append(oldest)
return sorted_list
|
./refactory/data/question_4/code/wrong/wrong_4_267.py
|
refactory_data_question_4_wrong_4_318
|
def sort_age(lst):
lst.sort(lambda x: x[1], reverse = True)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_318.py
|
refactory_data_question_4_wrong_4_032
|
def sort_age(lst):
a=lst
sort=[]
while a:
smallest=a[0]
for element in a:
if element[1]<smallest[1]:
smallest=element
a.remove(smallest)
sort.append(smallest)
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_032.py
|
refactory_data_question_4_wrong_4_006
|
def sort_age(lst):
sort = []
while lst:
oldest = lst[0]
for person in lst:
if person[1] >= oldest[1]:
person = oldest
lst.remove(oldest)
sort.append(oldest)
return sort
|
./refactory/data/question_4/code/wrong/wrong_4_006.py
|
refactory_data_question_4_wrong_4_233
|
def sort_age(lst):
sort = []
while lst: # a is not []
smallest = (lst[0])[1]
for element in lst:
if element[1] < smallest:
smallest = element
lst.remove(smallest)
sort.append(smallest)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_233.py
|
refactory_data_question_4_wrong_4_104
|
def sort_age(lst):
sort1 = []
while lst:
largest = lst[0][1]
if i[1] > largest:
largest = i[1]
lst.remove(i)
sort1.append(i)
return sort1
|
./refactory/data/question_4/code/wrong/wrong_4_104.py
|
refactory_data_question_4_wrong_4_158
|
def sort_age(lst):
lst.sort(key = lambda x:x[1], reverse=True)
print (lst)
|
./refactory/data/question_4/code/wrong/wrong_4_158.py
|
refactory_data_question_4_wrong_4_065
|
def sort_age(lst):
rslt=[]
while lst:
smallest=a[0]
for element in a:
if element[1]>smallest[1]:
smallest=element
lst.remove(smallest)
rslt.append(smallest)
return rslt
|
./refactory/data/question_4/code/wrong/wrong_4_065.py
|
refactory_data_question_4_wrong_4_108
|
def sort_age(lst):
lst.sort(key=lambda x: x[1], reverse=True)
return lst
|
./refactory/data/question_4/code/wrong/wrong_4_108.py
|
refactory_data_question_4_wrong_4_305
|
def sort_age(lst):
lst.sort(key=lambda x:x[1])
lst.reverse()
print(lst)
|
./refactory/data/question_4/code/wrong/wrong_4_305.py
|
refactory_data_question_4_wrong_4_321
|
def sort_age(lst):
newlst=[]
for i in lst:
big=lst[0]
for n in lst:
if n[1]>big[1]:
big=n
lst.remove(big)
newlst.append(big)
return newlst
|
./refactory/data/question_4/code/wrong/wrong_4_321.py
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.