Appending to []
a = [].append('x').append('y').append('z'). would be possible with a containing the resulting list ['. x', 'y', 'z']. That is the way I expect any append to behave.
a = [].append('x').append('y').append('z'). would be possible with a containing the resulting list ['. x', 'y', 'z']. That is the way I expect any append to behave.
Do you not know how to code some part? Are you getting an error? If so show us the full error text. WE are not mind readers, you need to tell us what you want to know. As for the code below, I've added a few remarks... > #Task: Create the empty data structure > grocery_item = {} > >.
block calls the function append_row.What if you have append_row return a Boolean? True on success, False on failure but situation handled (i.e. append_row has shown an error, or whatever recovery you adopt).
Also, as a quick note: Python list append is not functional: it mutates rather than returns a useful return value. You may need to revisit the parts in the code where it assumes a different behavior from functional append.