Character Movement

ok I got a character, that I want to have different animations for depending on what buttons are being hit and I’m using python to program it

exp…
up key = “run forward animation”
left key = “run left animation”
up + left key = “run diagonal animation”

any python exper’s know how I can do this? I already tried the sample below and several other variations

if up.isPositive() :
animate = “run forward animation”
if left.isPositive() :
animate = “run diagonal animation”
if left.isPositive() :
animate = “run left animation”