Skip to main content
Post Undeleted by friddo
added 34 characters in body
Source Link
friddo
  • 613
  • 4
  • 6

Python 3.8 (pre-release), 6068 bytes

f=lambdalambda p,c:(f:=lambda p,a=0:f(p[1:],c,eval(f'(a{c[p[0]]})'))if p else a) 

Try it online!Try it online!

replaces the '=' operator with ':=' in order to utilize python 3.8+ walrus expressions

Python 3.8 (pre-release), 60 bytes

f=lambda p,c,a=0:f(p[1:],c,eval(f'(a{c[p[0]]})'))if p else a 

Try it online!

Python 3.8 (pre-release), 68 bytes

lambda c:(f:=lambda p,a=0:f(p[1:],eval(f'(a{c[p[0]]})'))if p else a) 

Try it online!

replaces the '=' operator with ':=' in order to utilize python 3.8+ walrus expressions

Post Deleted by friddo
Source Link
friddo
  • 613
  • 4
  • 6

Python 3.8 (pre-release), 60 bytes

f=lambda p,c,a=0:f(p[1:],c,eval(f'(a{c[p[0]]})'))if p else a 

Try it online!