Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
338 B
6
Indexable
Never
def afunc(strArr):
    l=[]
    d={}
    print(strArr)
    for i,j in enumerate(strArr):
        for k,l in enumerate(strArr):
            if j[0]==l[0]:
                sum= int(j[2:])+int(l[2:])
                d[j[0]]=sum
    print(d)



if __name__=="__main__":
    x=['X:-1','X=-4','Y=3','X:5','Y:-1']
    afunc(x)