My 5th kata, and 1st in a planned series of rock climbing themed katas.

In rock climbing ([bouldering](https://en.wikipedia.org/wiki/Bouldering) specifically), the V/Vermin (USA) climbing grades start at `'VB'` (the easiest grade), and then go `'V0'`, `'V0+'`, `'V1'`, `'V2'`, `'V3'`, `'V4'`, `'V5'` etc. up to `'V17'` (the hardest grade). You will be given a `list` (`lst`) of climbing grades and you have to write a function (`sort_grades`) to `return` a `list` of the grades sorted easiest to hardest.

If the input is an empty `list`, `return` an empty `list`; otherwise the input will always be a valid `list` of one or more grades.

Please do vote, rank, and provide any feedback on the kata.

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Sorting

Data structures

Starter code: def sort_grades(lst):
	

Solutions:
def sort_grades(gs):
	return sorted(gs, key=grade)

def grade(v):
	if v == 'VB':
		return -2
	if v == 'V0':
		return -1
	if v == 'V0+':
		return 0
	return int(v[1:])


G = {str(k): k for k in range(1, 18)}
G['B'] = -2
G['0'] = -1
G['0+'] = 0

def sort_grades(gs):
	return sorted(gs, key=lambda g: G[g[1:]])
G = ['B', '0', '0+'] + [str(g) for g in range(1, 18)]

def sort_grades(gs):
	return sorted(gs, key=lambda g: G.index(g[1:]))


def sort_grades(lst):
	return sorted(lst, key=lambda s: float(s[1:].replace('B', '-1').replace('+', '.5')))


def sort_grades(lst):
	grades = ['VB', 'V0', 'V0+', 'V1', 'V2', 'V3', 'V4', 'V5', 'V6', 'V7', 'V8', 'V9', 'V10', 'V11', 'V12', 'V13', 'V14', 'V15', 'V16', 'V17']
	return sorted(lst, key=lambda x: grades.index(x))


def sort_grades(lst):
	grades = ['VB', 'V0', 'V0+'] + ['V' + str(i) for i in range(1, 18)]
	return [i for i in grades if i in lst]


def sort_grades(lst):
	grades = ['VB', 'V0', 'V0+']
	for i in range(1, 18):
		grades.append('V' + str(i))
	return sorted(lst, key=grades.index)


def sort_grades(lst):
	grades = ['VB', 'V0', 'V0+'] + ['V{}'.format(i) for i in range(1, 18)]
	return sorted(lst, key=lambda l: grades.index(l))


climbing_grades = 'VB V0 V0+'.split() + ['V{}'.format(i) for i in range(1, 18)]

def sort_grades(lst):
	return sorted(lst, key=climbing_grades.index)


def sort_grades(a):
	return sorted(a, key=lambda k: 'B00+1 2 3 4 5 6 7 8 9 1011121314151617'.index(k[1:]))


sort_grades = lambda l: sorted(l, key=lambda g: float(g[1:].replace('+', '.5').replace('B', '-1')))