Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

split multiple times

name_scr = 'alvinone-90,80,70,50|simonthree-99,80,70,90|theotwo-90,90,90,65'
test_scr = {}

for persinfo in name_scr.split('|'):
    name,scores = persinfo.split('-')
    test_scr[name] = map(int,scores.split(','))

print test_scr
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #split #multiple #times
ADD COMMENT
Topic
Name
5+7 =