Answer to Question #89077 in Python for josh

Question #89077
Write a method that builds an array by appending a given number of random two-digit integers. It should accept an array and how many values to add as parameters.
Print the array after calling the array.
Sample Run:
How many values to add to the array:
12
[14, 64, 62, 21, 91, 25, 75, 86, 13, 87, 39, 48]
1
Expert's answer
2019-05-03T10:55:07-0400
from random import randint

def Build_Array(array,count):
  array = [randint(10,99) for i in range(count)]
  return array

count = int(input("How many values to add to the array:\n"))
array = Build_Array([],count)
print(array)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS