Mar-26-2022, 03:28 PM
for display:
>>> out = ["Bob", "Alice"] >>> print(f"Hello {' and '.join(out) if out else 'stranger'}") Hello Bob and Alice >>> out.pop() 'Alice' >>> print(f"Hello {' and '.join(out) if out else 'stranger'}") Hello Bob >>> out = [] >>> print(f"Hello {' and '.join(out) if out else 'stranger'}") Hello stranger >>>
I speak Python but I don't speak English (I just read it a little). If I express myself badly, please blame the translator^^.