[split] capitalize dict keys for display in string
https://python-forum.io/thread-21698.html10.10.2019 · as it is now your getList will return just the first key (see the indentation of the return statement) def getList(categories): for cat in categories.keys(): return cat.capitalize() probably you want def getList(categories): return [cat.capitalize() for cat in categories.keys()] # this will return list of keys() # return ', '.join(cat.capitalize() for cat in categories.keys()) # this will ...