l = [100, 200, 300, 400, ,500]
if a <= 100:
y = 0
elif a <= 200:
y = 1
elif a <= 300:
y = 2
elif a <= 400:
y = 3
else:
y = 4
def group_place(a):
l = [100, 200, 300, 400, 500]
for i in range(0, len(l)):
if a <= l[i]: break
return i
def get_group(value, sorted_list):
for i, breakpoint in enumerate(sorted_list):
if value < breakpoint:
return i
# значение больше последнего в списке
return len(sorted_list)
l = [100, 200, 300, 400, 500]
print(get_group(215, l))