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]

Expert's answer

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)
LATEST TUTORIALS
APPROVED BY CLIENTS