TypeError: 'NoneType' object is not subscriptable
hedia
-
yg_be Messages postés 23541 Date d'inscription Statut Contributeur Dernière intervention -
yg_be Messages postés 23541 Date d'inscription Statut Contributeur Dernière intervention -
def saisir(): while True: n=input("donner une chaine numérique de 15 chiffres") if len(n)==15 and n.isnumeric(): break def doubler(x:int): return x*2 def somme(n): s=0 for i in range(15): if i%2==0: s=s+doubler(int(n[i])) s=s+int(n[i]) return s def affiche(n): if somme(n)%10==0: print('oui IMEI') else: print('non IMEI') #programme principal n=saisir() affiche(n)
A voir également:
- 'Nonetype' object is not subscriptable
- Typeerror: botbase.__init__() missing 1 required keyword-only argument: 'intents' ✓ - Forum Python
- Typeerror: can't multiply sequence by non-int of type 'str' - Forum Python
- TypeError: 'int' object is not iterable ✓ - Forum Python
- TypeError: 'float' object is not subscriptable - Forum Python
- Uncaught typeerror: cannot read properties of null (reading 'addeventlistener') ✓ - Forum Javascript
1 réponse
yg_be
Messages postés
23541
Date d'inscription
Statut
Contributeur
Dernière intervention
Ambassadeur
1 584
bonjour,
que penses-tu faire en ligne 26?
que penses-tu faire en ligne 26?