Sorry, I am new to Python and stuck on this function.
item_pencil = {
"id": "pencil",
"name": "a HB Pencil",
"description":
"Normal pencil"
}
item_pen = {
"id": "pen",
"name": "a Ballpoint Pen",
"description":
"Standard ballpoint pen"
}
I have coded this function but it returns everything about the items
def list_of_items(items):
n = ",".join(map(str, items))
#n = ",".join([str(name) for name in items])
return n
print(list_of_items([item_pen, item_pencil]))
The output I get
{'id': 'pen', 'name': 'a Ballpoint Pen', 'description': 'Standard ballpoint pen.'},
{'id': 'pencil', 'name': 'a HB Pencil', 'description': 'Normal Pencil'}
But the output I want is this
'a Ballpoint Pen, a HB Pencil'
I'm sorry if I am missing something obvious. Thanks in advance