Question: Write a Python function that generates a vector of 1 0 elements with integer values between 1 - 3 . Generate a dictionary that counts

Write a Python function that generates a vector of 10 elements with integer values between 1-3. Generate a dictionary that counts how many ones, twos , and threes were generated. Return the dictionary. You can use below two command to generate a vector of 10 elements: import numpy as np v=np.random.randint(1,4,[10])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!