Commit e0ced162 authored by Robbe Van Herck's avatar Robbe Van Herck

Display None when there is none

parent 25d7d732
......@@ -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"],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment