I want to make for example, I have 3 keywords Apple, Orange, and Banana. I want these three keywords to be printed randomly, for example:
- Apple Orange Banana
- Orange Banana Apple
- Banana Apple Orange
- etc
until the possibilities run out
I've written to randomize the keywords, but the code I wrote can only print 1 sentence. how to print multiple sentences at once until the possibilities run out?
This is my Code
import random
words = ('Banana', 'Apple', 'Orange')
result = ''.join(random.sample(words, k=len(words)))