我收到以下代码的属性错误:
coininfo = [ {} for k in range(0,numberOftrials)]
coininfo[i].append([x,outcome(x)])
以下是我得到的确切错误屏幕:
Traceback (most recent call last):
File "pr1.py", line 22, in <module>
runsimulation(numberOftrials,numberOfcoins)
File "pr1.py", line 19, in runsimulation
coininfo[i].append([x,outcome(x)])
AttributeError: 'dict' object has no attribute 'append'
任何帮助表示赞赏!