J'essaie de créer un programme simple qui vous indique votre numéro porte-bonheur selon la numérologie. Je continue à avoir cette erreur :
File "number.py", line 12, in <module>
sumln = (int(sumall[0])+int(sumall[1]))
TypeError: 'int' object is not subscriptable
Mon script est :
birthday = raw_input("When is your birthday(mm/dd/yyyy)? ")
summ = (int(birthday[0])+int(birthday[1]))
sumd = (int(birthday[3])+int(birthday[4]))
sumy= (int(birthday[6])+int(birthday[7])+int(birthday[8])+int(birthday[9]))
sumall = summ + sumd + sumy
print "The sum of your numbers is", sumall
sumln = (int(sumall[0])+int(sumall[1]))
print "Your lucky number is", sumln`