Computer Science, asked by handesnehal556, 1 year ago

Which of the following methods of 'random' module is used to pick a single element, randomly, from a given list of elements?
a. choose
b. choice
c. sample
d. pick

Answers

Answered by myrakincsem
6

HI there,

In order to pick a single element, randomly, from a given list of elements, sample method is used.

Therefore, in the above question. Option C: Sample is the correct option.

I hope you are satisfied.

Thanks.

Answered by rahuldev2910
6

Answer:

b) choice

Explanation:

In order to pick a single element, randomly, from a given list of elements, choice method is used.

sample is used to pick more than one item from a list

Therefore, in the above question. Option b choice is the correct option.

Refer to the below article for more detail

https://pynative.com/python-random-choice/

Similar questions