Answered step by step
Verified Expert Solution
Question
1 Approved Answer
can you help just with this two questions thank you. Q2(d)(i) The code below defines a method to output all of the orders for a
can you help just with this two questions thank you.
Q2(d)(i)
The code below defines a method to output all of the orders for a given customer. The code breaks a number of coding style guidelines suggested within M269.
def loop_through_orders_looking_for_customer(thelist, c): i = 0 for item in thelist.items: for key in item: if key == 'customer' and item[key] == c: print(item) i+=1 return i
Identify four areas where the coding style does not meet M269 guidelines. For each one, suggest an improvement/change that could be made with examples where appropriate.
Write your answer here
Q2(d)(ii)
State the complexity of loop_through_orders_looking_for_customer() and explain your reasoning.
Write your answer here
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