From e0ced162f4def694ca82bc810311453fc6eeed80 Mon Sep 17 00:00:00 2001 From: Robbe Van Herck Date: Mon, 18 Mar 2019 11:56:32 +0100 Subject: [PATCH] Display None when there is none --- app/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/app.py b/app/app.py index 2439706..33cc852 100644 --- a/app/app.py +++ b/app/app.py @@ -235,6 +235,8 @@ def resto_menu(): else: def table_for(kind): items = [meal for meal in resto["meals"] if meal["kind"] == kind] + if len(items) == 0: + return "None :(" maxwidth = max(map(lambda item: len(item["name"]), items)) return "\n".join("{name: <{width}}{price}".format( name=item["name"],