Tuesday, January 1, 2019

Saurakanti's Problem

import random
Random_Words = []
Words = ['Apple', 'Website', 'Computer', 'Book', 'Python', 'Car', 'Web-design', 'Boy']
Words_Copy = Words.copy()
while len(Words_Copy) > 0:
word = random.choice(Words_Copy)
Words_Copy.remove(word)
Random_Words.append(word)
print('Input:', Words)
print('Output:', Random_Words)

No comments: