Essentially I need to create a dictionary from a string of data
Given :
data = "electron1, gamma5, proton43, boson98, ..."
d(data) would result in:
{'electron':1, 'gamma':5, 'proton':43, 'boson':98, ...}
My current code is showing an error message of "base 10..."
def d(n):
pair = dict()
for i in range(0,n):
word = input().split()
key = word[0]
value = word[1]
pair[key]=value
print(pair)
n = int(input())
d ={}
for i in range(n):
text = input().split()
d[text[0]] = text[1]
print(d)