loto.py

Created by francoise-cavanne

Created on June 15, 2018

387 Bytes

Le tirage du loto et d’un numéro de chance . Utilisation de liste : tirage sans remise des 5 numéros de la grille.
Dans la console  »> tiragedujour ()


from random import choice, randint

#loto tirage : 5 numeros entre 1 et 49 sans double
#et numero chance entre 1 et 10
grille=list(range(1,50))

def tiragedujour():
    tirage=[]
    for i in range (5) :
         t=choice(grille)
         tirage.append(t)
         grille.remove(t)
    return tirage

def numerochance():
    n=randint(1,10)
    return "le numero chance " , n

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.