-3

let's suppose I have an array

array = [A, B, C, D, E]
how can I randomize the order of the items in this array and put everything together into a string variable to print it.

Example of output: CABDE

SnakeByte
  • 1
  • 2
  • `array = [A, B, C, D, E]` isn't even valid Python since you haven't declared `A`, `B`, `C`, `D`, or `E`. – Quelklef Apr 30 '18 at 21:56

1 Answers1

2

The word you're looking for is "shuffle"

import random
random.shuffle(array)
TwiN
  • 3,554
  • 1
  • 20
  • 31