I have a string in the form of:
s = 'A - 13, B - 14, C - 29, M - 99'
and so on (the length varies). What is the easiest way to create a dictionary from this?
A: 13, B: 14, C: 29 ...
I know I can split but I can't get the right syntax on how to do it. If I split on -
, then how do I join the two parts?
Iterating over this seems to much of a pain.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…