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 generate_sequence that has 2 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. i.e. 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 (i.e. a float value provided in a string datatype "23.15" 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 (i.e. ValueError).
Algorithm Rules
The first value in the sequence is the start value, rounded to 0 decimal places.
The next value in the sequence calculated following the four steps below:
Increment the last value added to the sequence by 3
Then, take the value from (a) and raise it to the power of 3
Then, take the value in (b), subtract 2.488045
Then, round the value from (c) to 0 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 -4 space =1 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!