📜  python in line elif - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:30.584000             🧑  作者: Mango

代码示例1
# You can nest if/else to get the same effect as elif but it's hard to read and not recommended
msg = "Hi " + ("there" if not name else ("Neo" if name == "Anderson" else name))