from collections import defaultdict
dic = defaultdict(list)
#a="f=(x+y)/(y+z)"
a="Pla = (Vla-Vlar)*Ela - Px2*(1/(exp((Vla)/Vx8)-1))"
print(a)
ls=a.split("=")
key=ls[0]
print(key)
#val=ls[1]
#val=[for i in ls[1]]
s=''
for i in ls[1]:
    if i in "+-/*":
        s+='@'
        continue
    if i not in " ([])exp":
        s+=i
print(s)
sl=s.split("@")
print(sl)
val= list(set([i for i in sl if i not in "0123456789"]))
print(val)
if len(dic[key])>0 and dic[key][-1]=='':
    dic[key][-1]=val
else:
    for i in val:
        dic[key].append(i)


print(dic)

Add a code snippet to your website: www.paste.org