• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Python by
Q:
Write code to show randomizing the items of a list in place in Python along with the output.

1 Answer

0 votes
by

from random import shuffle

x = ['hackr.io', 'Is', 'The', 'Best', 'For', 'Learning', 'Python']

shuffle(x) 

print(x)

Output:

['For', 'Python', 'Learning', 'Is', 'Best', 'The', 'hackr.io']

Related questions

+1 vote
asked Jul 10, 2021 in Python by sharadyadav1986
0 votes
asked Apr 3, 2020 in Big Data | Hadoop by Tate
...