Home > Net >  i can't understand why it gives me this error (TypeError: 'NoneType' object is not it
i can't understand why it gives me this error (TypeError: 'NoneType' object is not it

Time:12-10

my code image

I hope you can help me I am a beginner in python I tried a lot of times but I can't solve it

please help and thanks

CodePudding user response:

.append returns None after appending data.

Due, to which you are getting this TypeError:.....

CodePudding user response:

You are doing it wrong. if you want sum the numbers in the lists, do this:

for x in range(2):
  user_cards.append(random_card())
  computer_cards.append(random_card())


user_score = sum(user_cards)
computer_score = sum(computer_cards)
  • Related