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.
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 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 Best Website and Software Company in Allahabad