1.

What does random.shuffle(x) do when x = [1, 2, 3]?(a) error(b) do nothing, it is a placeholder for a function that is yet to be implemented(c) shuffle the elements of the list in-place(d) none of the mentionedThis question was posed to me during an interview for a job.The query is from Random Module topic in division Mapping Functions and Modules of Python

Answer»

Correct CHOICE is (c) shuffle the ELEMENTS of the list in-place

For EXPLANATION: The elements of the list PASSED to it are shuffled in-place.



Discussion

No Comment Found

Related InterviewSolutions