Hi everyone, I need some help with my Python homework. I have tried different codes but none of them work.
Posted: Mon May 09, 2022 6:16 am
Hi everyone, I need some help with my Python homework. I have tried different codes but none of them work.
Description Please write a program to generate an array of random integers. The input consists of four integers. The first is the seed for the random number generation. The second and third are the lower and upper bounds for the random number lower S random number < upper The fourth is how many numbers you are to generate. Input random number seed lower bound upper bound amount of number to generate Output A row of random numbers Sample input 1 1 0 5 20 Sample output 1 [3 4 0 1 3 0 0 1 4 4 1 2 4 2 4 3 4 2 4 2] Sample input 2 2 10 50 4 Sample output 2 125 18 32 28) Sample input 3 99 22 77 10 Sample output 3 [23 57 62 31 62 40 26 27 74 23] Reading Input (given) The following lines of code will help you read in the input integers In (): import numpy as np In (): # seed = int(input()) # Lower = int(input()) # upper = int(input()) # amount = int(input()) # np.random.seed (seed) In [ ]: seed = 1 lower = 0 upper = 5 amount = 20
Description Please write a program to generate an array of random integers. The input consists of four integers. The first is the seed for the random number generation. The second and third are the lower and upper bounds for the random number lower S random number < upper The fourth is how many numbers you are to generate. Input random number seed lower bound upper bound amount of number to generate Output A row of random numbers Sample input 1 1 0 5 20 Sample output 1 [3 4 0 1 3 0 0 1 4 4 1 2 4 2 4 3 4 2 4 2] Sample input 2 2 10 50 4 Sample output 2 125 18 32 28) Sample input 3 99 22 77 10 Sample output 3 [23 57 62 31 62 40 26 27 74 23] Reading Input (given) The following lines of code will help you read in the input integers In (): import numpy as np In (): # seed = int(input()) # Lower = int(input()) # upper = int(input()) # amount = int(input()) # np.random.seed (seed) In [ ]: seed = 1 lower = 0 upper = 5 amount = 20