fin cours 3

This commit is contained in:
pvalarcher
2022-10-26 18:22:20 +02:00
parent a261e7597e
commit 1b77a88561
8 changed files with 86 additions and 3 deletions

17
python/3/exo32.py Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env python3
## entrer un entier
## si il est entre 1 et 12
## alors
## afficher la table de multiplication
## sinon
## rien
n = int(input("Entrer un entier compris enter 1 et 12: "))
if n >= 1 and n <= 12: ## 1 ≤ n ≤ 12
for i in range(1, 11): ## [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
r = i * n
print(str(i) + " * " + str(n) + " = " + str(r)) ## i * n = r