CodePudding user response:
idDict={}try to turn the dictionary
IdData="HTTP://https://bbs.csdn.net/topics/id1: male; Id2: the han nationality; Id3: city of zhengzhou in henan province;"
SpIdData="https://bbs.csdn.net/topics/:". The join (idData. Split ('; ')). The split (' : ')
For I in range (len (spIdData)//2) :
IdDict [spIdData [2 * I]]=spIdData [* 2 + 1] I
Print (idDict [' id3 '])
CodePudding user response:
The split method