An empty string is a string containing zero characters. In Python, pressing Enter at an input prompt returns '', not None, and input always returns a string. section 1.2
An empty string is false in an if statement, so Python commonly tests it with if not value rather than comparing explicitly with '' or checking its length. section 1.13 section 4.4
Use empty strings as meaningful control and formatting values:
- Stop repeatedly prompting when the user submits an empty order; strip whitespace first so space-only input becomes empty. section 4.3 section 4.4
- Join characters with '' when the output should contain no separators, such as a translated word. section 2.13
- Pass end='' to print when existing line endings should not receive another newline. section 5.2
Ending a restaurant order
A loop can accept menu items, add their prices, reject unknown keys, and finish when order becomes empty. The idiomatic termination test is if not order; an explicit len(order) == 0 works but is less conventional. section 4.3 section 4.4
if not one_run: break
Compare the concise truthiness-based loop exit with the equivalent length-based check. section 1.13 section 4.4


