MCQ Answer

<p>What is the correct command to shuffle the following list?</p><pre><span style="font-size: 14px;">fruit=['apple', 'banana', 'papaya', 'cherry']</span></pre><div><br></div><p> </p>

What is the correct command to shuffle the following list?

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



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

fruit=['apple', 'banana', 'papaya', 'cherry']
Topic : Sequence data types in python

A. fruit.shuffle()

B. shuffle(fruit)

C. random.shuffle(fruit)

D. random.shuffleList(fruit)




Correct Answer is :

C. random.shuffle(fruit)



Explanation
To shuffle a list in Python, you can use the shuffle function from the random module.
Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2025 Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz