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.
Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad