def lvl(points: int):
if points <= 2:
return 0
if points <= 5:
return 1
if points <= 15:
return 2
levels = {0: 2, 1: 5, 2: 15}
def get_level(current_xp):
sorted_levels = dict(sorted(levels.items()))
for level, xp in sorted_levels.items():
if current_xp <= xp:
return level
else:
return list(sorted_levels)[-1]
print(get_level(9))