Question: Python code that executes the following is required REQUEST You have just been hired as a data analyst and the lead of the analyst team
Python code that executes the following is required

REQUEST You have just been hired as a data analyst and the lead of the analyst team has asked for your help. The team needs a simple way to generate two sequences of numbers to be used in their analysis projects. The lead has asked you to create a Python class to generate these two sequences of numbers. You have taken notes of the request, as follows: 1) I need to use a Python class, named get_numbers, so number sequences can be leveraged in all the department's projects 2) The basic idea is to simply call a class method, passing an integer argument, that generates one of two types of sequences of integer numbers, as a Python list with the requested number sequences. The number of items (or clements) in the Python list (which will have the requested numbers) will be equal to the integer argument being passed on to the class method. 3) The first sequence of numbers selected are random numbers less or equal than one thousand. I need to do the following: a. Name this method random_gen that generates random numbers b. This method takes one inbound integer argument, that I need to name length C. The lead asked me to use the Python secrets class, due to its cryptographic strengths, to generate numbers, I was specifically asked to use the randbelow method of this Python secrets class for this project. d. I need to use the randbelow method of this class to generate random numbers less or equal than one thousand C. Such numbers will be stored in a list, that will be returned to the caller of the method, using the return statement f. Thus, in summary, I will need to generate a loop of some sort, to generate the requested (this would be the length argument) random numbers, using the Python secrets class and its randbelow method, that are less or equal to one thousand. The numbers will be returned as a list, to its method caller, using the Python return statement. 4) The second sequence of numbers are Fibonacci numbers. I need to do the following: a. Name this method fib_gen that generates Fibonacci number. b. This method takes one inbound integer argument, that I need to name length. C. The generated numbers will be in a Python list, that is returned to the method caller using a return statement The number of items in the Python list is equal to the length integer argument being passed to the class method C . Thus, in summary, I will need to generate a loop of some sort, to generate the requested (this would be the length argument) Fibonacci numbers, stored in a Python list, results to be returned using the Python return statement. 5) The lead gave me the following URLs to research the design of my Python class project, as follows: a. b. https://docs.python.org/3.6/library/secrets.html#module-secrets https://en.wikipedia.org/wiki/Fibonacci number C. I was encouraged to search on stackoverflow.com and other sites for research QUALITY ASSURANCE STEPS The quality assurance steps I was provided are as follows: a - get_numbers ( ) print (a. random_gen(5)) print (a. fib_gen(5)) a.random_gen(5) will generate 5 random numbers (as outlined in section 3 above) in a list. Obviously, the numbers shown here will not match what my class will produce, since every time this method is called, random numbers will be generated. Here is an example of output to the Python console: In [8]: print (a. random_gen(5)) [114, 44, 281, 520, 53] a.fib_gen(5) will generate 5 Fibonacci numbers (as outlined in section 4 above) in a list. In this case, the Fibonacci numbers will match if I request a sequence of 5 numbers. Here is an example of output to the Python console: In [97]: print(a. fib_gen(5)) [1, 1, 2, 3, 5] SUBMISSION INSTRUCTION Name your Python script Assignment-2.py and submit via Canvas before the published deadline for this assignment
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
