ValueError: too many values to unpack (expected 2)

记录下总是码错的地方

for key,value in final_table:#final_table is a dict

然后报错

1 File "./count_co_Mty_read_nu.py", line 190, in count_haplotype_read_number
2     for key,value in final_table:
3 ValueError: too many values to unpack (expected 2)

字典是的迭代元素是字典的key值,多加了一个value值

正确的写法是:

for key,value in final_table.items():

 

posted @ 2017-08-08 21:21  ZzzzHong  阅读(3110)  评论(0编辑  收藏  举报