Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] webmail now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as Python by registered user __SMRITI__ ( 1 year ago )
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)

 

Revise this Paste

Children: 123877
Your Name: Code Language: