Aléatoire avec probabilités (python)
Résolu/Fermé
A voir également:
- Aléatoire avec probabilités (python)
- Citizen code python - Guide
- Python retour à la ligne dans le code - Forum Python
- Vlc lecture aléatoire - Forum Téléphones & tablettes Android
- Tirage au sort excel aléatoire sans doublon ✓ - Forum Excel
- Geometry dash python ✓ - Forum Python
2 réponses
hypothetix
Messages postés
191
Date d'inscription
dimanche 19 janvier 2020
Statut
Membre
Dernière intervention
24 avril 2024
53
29 sept. 2022 à 20:38
29 sept. 2022 à 20:38
Bonsoir,
import random tableau = [0, 1, 2, 3] print(random.choices(tableau, weights=(10, 15, 25, 50), k=10))
29 sept. 2022 à 20:46
Ah oui, bien mieux, trop peu usitée cette fonction.