[Python] How to reorder numbers in a set in Python so that the set's numbers are increasing?

Discussão em 'Python' iniciado por Stack, Agosto 22, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to reorder the randomly generated numbers of a set, and I don't know how to do so:

    import numpy as np
    import random as rd

    NUMBER=5
    c = np.zeros(NUMBER+1)
    for k in range(1,NUMBER+1):
    c[k] = rd.uniform(1,10)


    From there on I don't know how to reorder the numbers in c in order to make them increasing.

    Continue reading...

Compartilhe esta Página