• How would you randomize the contents of a list in-place?

    How would you randomize the contents of a list in-place?

    Silver Member Asked on June 4, 2018 in Python.
    Add Comment
  • 1 Answer(s)
    
    mylist=[0,1,2,3,4,5,6,7,8]
    
    from random import shuffle
    
    shuffle(mylist)
    
    mylist
    
    
    Silver Member Answered on June 4, 2018.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.