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: 'float' object is not subscriptable - Forum Python
- TypeError : 'builtin function or method' et '_getitem__' ✓ - Forum Python
- Uncaught TypeError: document.getElementsById is not a functi ✓ - Forum Javascript
- Typeerror pdfjslib is undefined sur le plugin pdfviewer - Forum Javascript
- TypeError: __init__() takes X positional arguments but ... - Forum Python
1 réponse
yg_be
Messages postés
23541
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?