<human>:  Can you show me a Python code to get nearest position in the list.
<bot>:

# Enter the position
pos = 5

# Calling the function
idx = get_nearest_pos(pos_list, pos)

# Print the index
print(idx)

#Remember to inspect code for bugs.