Answers for "split multiple times"

1

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
Posted by: Guest on September-30-2021

Code answers related to "split multiple times"

Browse Popular Code Answers by Language