Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started