Answered step by step
Verified Expert Solution
Question
1 Approved Answer
b . In this part of the question, you will implement the final steps in the top - level decomposition given at the beginning of
b In this part of the question, you will implement the final steps in the toplevel decomposition given at the beginning of this question:
Find the sum of the items in the transformed list
If the remainder of the sum divided by is result is valid, else result is invalid
Print the result
So for example, for this step, if the input is the list:
The output valid will be printed.
i Identify a pattern that could best be applied to the solution of the second task given that you should not use the sum function. State clearly the name of the pattern and the pattern number, for example 'List generation Pattern A list of all the patterns can be found in the Problem solving and Python quick reference.
Note in addition to the pattern you have identified, you will also need to use Pattern case analysis, two cases
ii Write an algorithm based on the pattern you have identified.
iii. Implement your algorithm as Python code. This must match the steps of your algorithm and you should use comments in the code to make it clear how the two correspond. Marks will be lost if the program does not follow the algorithm. Your code should include a comment that gives your PI number. Copy your Python code for this second task as text, using an evenly spaced font such as New Courier or Consolas, into your Solution document. Name your Python file QbOUCU.py where 'OUCU' is your OU computer username, eg abc Then include the code file in your TMA zip file.
You should aim to use only the Python features that are introduced in the module. If you decide to use techniques or language features that TM does not cover
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