Add exercises 1, 2 and 3

This commit is contained in:
Tutur33
2023-11-28 22:07:56 +01:00
parent d4fdd986cf
commit 5dbad5630f
290 changed files with 9783 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import random
nombre = random.randint(1,100)
coup = 0
a = None
print("Le jeu consiste à deviner un nombre entre 1 et 100 :")
while a != nombre:
coup += 1
a = int(input("--> "))
if a < nombre:
print("trop petit !")
elif a > nombre:
print("trop grand !")
else:
print(f"Gagné en {coup} coups !")