摘要:
1. TypeError: string indices must be integers, not str 字符串类型取第index个字符的时候,应该传入int而不是str。如 view source print? 1 a='abcdef' 2 print a[0] 3 #而不是 print a[ 阅读全文
摘要:
TypeError:'dict' object is not callable 出现这种错误有两种可能: 1. 代码里重新定义了dict,比如 dict= {...},这时调用的是代码里定义的dict而不是python内置类型 2. 取字典内容时用了()而不是[]。比如sdict("content_ 阅读全文