Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

def show _ list ( self ) : line _ base _ len = len ( ' TOTAL ' ) - 4 max _ item

def show_list(self):
line_base_len = len('TOTAL')-4
max_item = max(len(item.name) for item, _ in self.app_engine.shopping_list.list)
line_base_len = max(max_item, line_base_len)
total = Item('TOTAL', self.app_engine.shopping_list.get_total_price())
max_order = total.get_order()
max_name = len(total.name)
out = 'SHOPPING LIST
'
i =0
for i,(item, quantity) in enumerate(self.app_engine.shopping_list.list):
hide_price = self.app_engine.mask_index == i
padding = line_base_len - len(item.name)
out += item.get_list_item_str(quantity, True)+'......'+ item.get_price_str(quantity)+'
'
i +=1
hide_price = self.app_engine.mask_index == i
q_len =5
d_len =2
total_line = total.get_list_item_str()+'......'+ total.get_price_str(True)+'
'
hline ='-'* len(total_line)+'
'
return out + hline + total_line +'
' my code is not producing right output[RULE] The 'AppCLI' class has the 'run', 'execute_command', 'process_show', 'process_ask', 'show_items', and 'show_list' methods that work correctly.
[RESULT] FAILED (2)
[FEEDBACK] Given the 'show list' command, the 'app_engine.message' is assigned 'SHOPPING LIST'
apple (1x) $2.00
banana (1x) $4.00
jam (1x)$6.00
lemon (1x) $3.00
orange (1x)$1.00
walnut (1x) $5.00TOTAL $21.00
whereas it should be assigned 'SHOPPING LIST
apple (1x)dots.$02.00
banana (1x)... $04.00
jam (1x)dots..$06.00
lemon (1x).... $03.00
orange (1x)dots$01.00
walnut (1x)... $05.00
TOTAL .......... $21.00
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Samsung Galaxy S23 Ultra Comprehensive User Manual

Authors: Leo Scott

1st Edition

B0BVPBJK5Q, 979-8377286455

More Books

Students also viewed these Databases questions