publicMasters/python/3/exo32.py

17 lines
377 B
Python
Raw Normal View History

2022-10-26 18:22:20 +02:00
#!/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