Skip to content

Solución en base al algoritmo de Fisher-Yates #2

@Azunera

Description

@Azunera
from random import randrange

def shuffler(lista):
    lista_len= len(lista)
    for x in range(lista_len -1,0,-1):
        y= randrange(x+1)
        lista[x], lista[y] = lista[y], lista[x]
    return lista

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions