-1

Is there something similar in python we do this

left = (condition) ? val_a : val_b 

It seems not working in python.

Thanks for help

icn
  • 16,048
  • 37
  • 102
  • 135

1 Answers1

2
left = val_a if condition else val_b