[Python] Rounding down to closest value in a list [duplicate]

Discussão em 'Python' iniciado por Stack, Fevereiro 6, 2025.

  1. Stack

    Stack Membro Participativo

    Using Python, is there a way to compare a value to a list of values and round it down to the closest value in that list. For example, if I had a list consisiting of [100, 200, 300, 400] and 250 was the value under consideration, it would output 200.

    I found some examples online, but most of them have to do with finding the nearest value in a list.

    Continue reading...

Compartilhe esta Página