Python: Efficiently Using For Loop If-Else In A Single Line

Responsive image