lundi 28 mars 2022

How can I join multiple strings in not a specified order in Python? [duplicate]

I want to join strings but randomly. If I do this:

a = 'this'
b = 'is'
c = 'a'
d = 'string'
e =  ''

f = e.join(a + b + c + d)


output : 'this is a string'

This is excatly what I don't want.

I want to get string in random order. Like this:

'string this a is'



Aucun commentaire:

Enregistrer un commentaire