Python 字符串——巧取值和列表——巧取值 对比 1.字符串取值实例: samp_string = "Whatever you are, be a good one." for i in samp_string: print(i) ,len(samp_string)-,): print(samp_string[i]+samp_string[i+]) print('A=',ord("A")) print()) print('桃:',ord("桃"
def getdictvalue(d,code): result=[] if isinstance(d, dict) : try: value = d[code] result.append(value) except Exception as e: pass for valuedd in d.values(): if isinstance(valuedd,dict): yied_result=getdictvalue(valuedd,code) if len(yied_result) != 0