Problèmes comparaison "int" "list"
vicgrgn
-
Utilisateur anonyme -
Utilisateur anonyme -
Bonjour ,j'ai un programme à faire est à la ligne 11 j'ai une erreur qui est
( if int(ageParticipant[2]) > age:
TypeError: '>' not supported between instances of 'int' and 'list')
si quelqu'un peut me dire comment ne plus avoir cette erreur
Merci d'avance
1. source= open("C:\\Users\\Megaport\\Downloads\\jo.csv","r")
2. data = source.read()
3. lignes = data.split("\n")
4. lignes = lignes[1:]
5. lignesDetails = []
6. for ligne in lignes:
7. lignesDetails.append(ligne.split(","))
8. age = 0
9. ligneAge = []
10. for ageParticipant in lignesDetails:
11. if int(ageParticipant[2]) > age:
12. age = ageParticipant
13. ligneAge.append(ageParticipant)
( if int(ageParticipant[2]) > age:
TypeError: '>' not supported between instances of 'int' and 'list')
si quelqu'un peut me dire comment ne plus avoir cette erreur
Merci d'avance
1. source= open("C:\\Users\\Megaport\\Downloads\\jo.csv","r")
2. data = source.read()
3. lignes = data.split("\n")
4. lignes = lignes[1:]
5. lignesDetails = []
6. for ligne in lignes:
7. lignesDetails.append(ligne.split(","))
8. age = 0
9. ligneAge = []
10. for ageParticipant in lignesDetails:
11. if int(ageParticipant[2]) > age:
12. age = ageParticipant
13. ligneAge.append(ageParticipant)
A voir également:
- Problèmes comparaison "int" "list"
- Comparaison million milliard - Accueil - Technologies
- List disk - Guide
- Directory list & print - Télécharger - Divers Utilitaires
- Logiciel comparaison photo gratuit - Télécharger - Photo & Graphisme
- Int converter - Télécharger - Bureautique
1 réponse
Bonsoir
pour poster ton code, il faut faire comme décrit là https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code
Après on pourra commencer à t'aider.
pour poster ton code, il faut faire comme décrit là https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code
Après on pourra commencer à t'aider.