TypeError: 'NoneType' object is not subscriptable
hedia
-
yg_be Messages postés 24281 Date d'inscription Statut Contributeur Dernière intervention -
yg_be Messages postés 24281 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: list.append() takes no keyword arguments - Forum Python
- TypeError: 'int' object is not iterable ✓ - Forum Python
- TypeError: 'float' object is not subscriptable - Forum Python
- Uncaught TypeError: document.getElementsById is not a functi ✓ - Forum Javascript
- TypeError : 'builtin function or method' et '_getitem__' ✓ - Forum Python
1 réponse
yg_be
Messages postés
24281
Date d'inscription
Statut
Contributeur
Dernière intervention
Ambassadeur
1 586
bonjour,
que penses-tu faire en ligne 26?
que penses-tu faire en ligne 26?