Generer des nombres aleatoires... mais différents (python)

Generer des nombres aleatoires... mais différents (python) - Python - Programmation

Marsh Posté le 24-01-2009 à 14:49:46    

Bonjour,
je souhaite générer des nombres aléatoires avec la fonction random.randrange . J'en veux 10, je fais donc une boucle mais je n'arrive pas à lui faire comprendre que j'en veux dix différents... quelqu'un aurait il une solution svp et surtout est ce possible sans utiliser un if ?
 
merci de votre aide.

Reply

Marsh Posté le 24-01-2009 à 14:49:46   

Reply

Marsh Posté le 24-01-2009 à 14:51:42    

http://docs.python.org/library/ran [...] dom.sample


Message édité par masklinn le 24-01-2009 à 14:51:52

---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 24-01-2009 à 15:11:57    

merci bien :)

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed