Exercices sous python
Fermé
T-soft
Messages postés
7
Date d'inscription
mercredi 8 avril 2009
Statut
Membre
Dernière intervention
9 juin 2009
-
11 avril 2009 à 17:27
Yohan - 17 avril 2009 à 17:44
Yohan - 17 avril 2009 à 17:44
A voir également:
- Exercices sous python
- Citizen code python avis - Accueil - Outils
- Exercices word 2019 avec corrigés pdf - Forum Word
- Python est introuvable. exúcutez sans argument pour procúder ó l ✓ - Forum Python
- Mot secret python pix ✓ - Forum Python
2 réponses
Comme l'a dit Jeannot, tu n'as pas demandé n à l'utilisateur.
Pour compléter, voici le script avec le total des carrés :
integer = input ('Combien de carres voulez-vous afficher ? : ')
print
n = 0
total = 0
while n < integer :
n += 1
print n, 'x', n, ' = ', n*n
total += n*n
print
print 'Total des carres : ', total
Penses à l'indentation.
Pour compléter, voici le script avec le total des carrés :
integer = input ('Combien de carres voulez-vous afficher ? : ')
n = 0
total = 0
while n < integer :
n += 1
print n, 'x', n, ' = ', n*n
total += n*n
print 'Total des carres : ', total
Penses à l'indentation.