TypeError: 'int' object is not subscriptable

前端 未结 6 573
一生所求
一生所求 2020-12-13 09:08

I\'m trying to create a simple program that tells you your lucky number according to numerology. I keep on getting this error:

File \"number.py\", line 12, i         


        
6条回答
  •  忘掉有多难
    2020-12-13 09:30

    You can't do something like that: (int(sumall[0])+int(sumall[1]))

    That's because sumall is an int and not a list or dict.

    So, summ + sumd will be you're lucky number

提交回复
热议问题