python in line elif

Solutions on MaxInterview for python in line elif by the best coders in the world

showing results for - "python in line elif"
Nayla
05 Mar 2018
1# You can nest if/else to get the same effect as elif but it's hard to read and not recommended
2msg = "Hi " + ("there" if not name else ("Neo" if name == "Anderson" else name))
3