Question: def show _ list ( self ) : line _ base _ len = len ( ' TOTAL ' ) - 4 max _ item
def showlistself:
linebaselen lenTOTAL
maxitem maxlenitemname for item, in self.appengine.shoppinglist.list
linebaselen maxmaxitem, linebaselen
total ItemTOTAL self.appengine.shoppinglist.gettotalprice
maxorder total.getorder
maxname lentotalname
out 'SHOPPING LIST
i
for iitem quantity in enumerateselfappengine.shoppinglist.list:
hideprice self.appengine.maskindex i
padding linebaselen lenitemname
out item.getlistitemstrquantity True item.getpricestrquantity
i
hideprice self.appengine.maskindex i
qlen
dlen
totalline total.getlistitemstr total.getpricestrTrue
hline lentotalline
return out hline totalline
my code is not producing right outputRULE The 'AppCLI' class has the 'run', 'executecommand', 'processshow', 'processask', 'showitems', and 'showlist' methods that work correctly.
RESULT FAILED
FEEDBACK Given the 'show list' command, the 'appengine.message' is assigned 'SHOPPING LIST'
apple x $
banana x $
jam $
lemon x $
orange $
walnut x $TOTAL $
whereas it should be assigned 'SHOPPING LIST
apple $
banana x $
jam $
lemon x $
orange $
walnut x $
TOTAL $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
