Question: Task Write a python function named generate _ sequence that has 2 parameters, startValue and maxValue. This function should: Validate the provided parameter values as
Task
Write a python function named generatesequence that has parameters, startValue and maxValue.
This function should:
Validate the provided parameter values as instructed below
Generate a sequence as a list of numbers using the algorithm specified below
Return not print the generated sequence as a list of numbers
You should not define any additional functions in your work. ie your work should contain only the required function.
Validation Rules
You must validate the parameter values as specified below:
startValue should contain an integer value
maxValue should contain a float value
If any of the provided parameters are invalid, the function should return an empty list.
When validating, you should assume that a valid parameter can have a datatype that is incorrect while having a correct value ie a float value provided in a string datatype should be accepted as a valid value
Your program should not crash nor emit unhandled errors. Any usage of except should be followed by a specific error being trapped ie ValueError
Algorithm Rules
The first value in the sequence is the start value, rounded to decimal places.
The next value in the sequence calculated following the four steps below:
Increment the last value added to the sequence by
Then, take the value from a and raise it to the power of
Then, take the value in b subtract
Then, round the value from c to decimal places
Repeat the steps above until the final value added to the sequence is greater than the value provided in maxValue.
Your code should meet the following coding standards:
Indentation space tab
Variables must be in lowerCamelCase style and be meaningfully named
Your code file should also contain file header and function header documentation
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
