Give an example of a shuffle() method?
Answer / Rohit Kumar Mishra
The 'shuffle()' method is a part of Python's built-in 'random' module. It randomly rearranges the elements in a list or any other mutable sequence. For example: 'import random'; 'my_list = [1, 2, 3, 4, 5]'; 'random.shuffle(my_list)'.
| Is This Answer Correct ? | 0 Yes | 0 No |
How do you dispose a variable in python?
What is the purpose of is, not and in operators?
In python, are there any databases to DB packages?
What's the worst programming language?
Is python can be compatible with command prompt?
What is the use of break statement?
How do you extend in python?
Is python call by reference or value?
What are built in types in python?
What does the map() function do?
How do you disconnect from the database?
How would you implement inheritance in python?