Search for question
Question

Question 1. (random_generator.py): Develop a function called random_generator that accepts two arguments. The first argument is an integer 'n' that represents the quantity of random numbers to be generated. The second argument is an integer 'k' that represents the maximum value of the randomly generated numbers. The program should then generate a list of 'n' random integers from 0 to 'k' (inclusive). The program should print the random numbers in a single line, separated by spaces. Develop another function called generate that accepts no arguments. This function should ask the user to enter two integers separated by a space. The values correspond to the arguments of the random_generator function, i.e. the first value is the quantity of random numbers to generate and the second value is the maximum value of the generated numbers. This function should use those two input values to call the random_generator function. Upon completion of generating the first set of random values, the program should repeat the cycle and prompt the user for another set of entries. The cycle should continue until the user enters "quit" at the prompt. A sample execution scenario is shown below. Enter # of values / max value: 42 0121 Enter # of values / max value: 105 2142545103 Enter # of values / max value: quit

Fig: 1