input: Write a function to generate an array of specified length filled with random numbers between 1 and 100. If no length is provided, the function should return an empty array.
  assert populateArray(5)
  assert populateArray(3)
  assert populateArray(0)
  assert populateArray(7)
  assert populateArray(None)
output: def populateArray(length=None):
      if length is None:
          return []
      import random
      return [random.randint(1, 100) for _ in range(length)]