Report Bug

Qus

What will be the output of the following Python function, assuming that the random library has already been included?

random.shuffle[1,2,24]

Qusनिम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा, यह मानते हुए कि रैंडम लाइब्रेरी को पहले से ही शामिल किया गया है?


A. Randomized list containing the same numbers in any order
B. The same list, that is [1,2,24]
C. A list containing any random numbers between 1 and 24
D. Error


Solution
D. Error



Explanation

The function shown above will result in an error because this is the incorrect syntax for the usage of the function shuffle(). The list should be previously declared and then passed to this function to get an output. An example of the correct syntax:

>>> l=['a','b','c','d']

>>> random.shuffle(l) 

>>> print(l)

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad