fin cours 3
This commit is contained in:
17
python/3/exo32.py
Executable file
17
python/3/exo32.py
Executable 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
|
||||
|
||||
|
Reference in New Issue
Block a user