Mar-26-2022, 03:28 PM
for display:
1 2 3 4 5 6 7 8 9 10 11 |
>>> 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^^.