I don't think you really want a bunch of variables, especially if the list grows large. Instead I think you want a dictionary
where the names are the key and the number is the value.
I would start by splitting your string
into a list
as described in this question/answer.
s=
"Martin 9
Leo 10
Elisabeth 3"
listData = data.splitlines()
Then I would turn that list
into a dictionary
as described in this question/answer.
myDictionary = {}
for listItem in listData:
i = listItem.split(' ')
myDictionary[i[0]] = int(i[1])
Then you can access the number, in Leo's case 10
, via:
myDictionary["Leo"]
I have not tested this syntax and I'm not used to python, so I'm sure a little debugging will be involved. Let me know if I need to make some corrections.
I hope that helps :)