Loading…
Call np.random.seed(0), then create an array of 10 random floats with np.random.rand(10). Multiply the array by 2 in a vectorized way (no loop). Print one line: VECTOR_SUM: followed by the sum of the result formatted to 4 decimal places, e.g. print(f"VECTOR_SUM: {total:.4f}").
Create a free account to save your progress and reveal the worked answer for this free exercise. The complete practice library is available with Practice Pass or Mastery.
Create a free account to save your progress and reveal the worked answer for this free exercise. The complete practice library is available with Practice Pass or Mastery.