2021年5月7日星期五

I get this error: 'list' object has no attribute 'countPoints'

When I import this code that I typed in here in to another code I get the error: 'list' object has no attribute 'countPoints' .

  import ModuleRollDice as dce  

def judge(rollPlayerA,rollPlayerB):

if not all(item in dce.options for item in rollPlayerA) or not all(item in dce.options for item in rollPlayerB):        print("error")    if rollPlayerA.countPoints(rollPlayerA[0]) == len(rollPlayerA) and rollPlayerB.countPoints(rollPlayerB[0]) != len(rollPlayerB):        return "A"    if rollPlayerA.countPoints(rollPlayerA[0]) != len(rollPlayerA) and rollPlayerB.countPoints(rollPlayerB[0]) == len(rollPlayerB):        return "B"    elif sum(rollPlayerA) == sum(rollPlayerB):      return "tie"  elif sum(rollPlayerA) > sum(rollPlayerB):      return "A"  else:       return "B"  return   
https://stackoverflow.com/questions/67432188/i-get-this-error-list-object-has-no-attribute-countpoints May 07, 2021 at 05:18PM

没有评论:

发表评论