Report Bug
Qus :

What is the correct command to shuffle the following list?

fruit=['apple', 'banana', 'papaya', 'cherry']


Qus

निम्नलिखित सूची में फेरबदल करने के लिए सही कमांड क्या है?

fruit=['apple', 'banana', 'papaya', 'cherry']


A. fruit.shuffle()
B. shuffle(fruit)
C. random.shuffle(fruit)
D. random.shuffleList(fruit)


Solution
C. random.shuffle(fruit)



Explanation
To shuffle a list in Python, you can use the shuffle function from the random module.



Report Bug