-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloto.py
More file actions
36 lines (22 loc) · 692 Bytes
/
Copy pathloto.py
File metadata and controls
36 lines (22 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# tirage du loto
# Depuis 2008, il faut désormais obtenir cinq numéros parmi 49
# plus un « numéro chance » parmi dix.
import random
numeros = list()
# cette fonction permet le tirage des 5 numéros
def tirage_numeros():
for i in range(5):
numeros.append(random.randint(1, 49))
# cette fonction permet le tirage du numéro chance
def tirage_chance():
return random.randint(1, 10)
# programme principal
print("Tirage du Loto")
print("--------------\n")
tirage_numeros()
print("liste des numéros: ", end="")
for value in numeros:
print(f"{value} ", end="")
print()
print(f"Le numéro chance: {tirage_chance()}")
print("\nBonne chance !\n")