當前位置:成語大全網 - 新華字典 - python,,TypeError: string indices must be integers如何解決?

python,,TypeError: string indices must be integers如何解決?

由錯誤原因可以看出 在176行中的value是string類型,並不是字典

string只能根據整數或者整數對下標獲取字符或者子字符串

字典可以通過key值獲取

這個需要排查 value的數值類型