🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

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

What is the correct command to shuffle the following list?

fruit=['apple', 'banana', 'papaya', 'cherry']
A
fruit.shuffle()
B
shuffle(fruit)
C
random.shuffle(fruit)
D
random.shuffleList(fruit)
Explanation

To shuffle a list in Python, you need to use the shuffle function from the random module. The correct command is:

random.shuffle(fruit)

So, the correct answer is (C) random.shuffle(fruit).

Correct Answer: C) random.shuffle(fruit)

Latest Updates