import random
words = ['nugget', 'jasmine', 'trolley', 'weight', 'soap']
mywords = []
random.shuffle(words)
mywords.append(random.sample(words, 2))
print("Words: ")
for i in words:
print(str(i))
print("My Words: ")
for i in mywords:
print(str(i))
I am working on an example that moves items from one list to another. The example seems to work as intended except for the output of the second list 'mywords', which prints in brackets and not as an unordered list as the list 'words' prints. Any suggestions? My guess is it has something to do with the append function I used.