I am trying to return a unique element from the list when user proceeds with the program, I tried with converting list to set and back to list, but there was no success. The initial code with duplicates is:
import random
topics = ['Technologies', 'Lifestyle', 'The meaning of life', 'Family', 'News', 'Vacations']
def ready_steady():
ready = input('Ok! (q to quit, enter to continue):')
while ready == '':
print(random.choice(topics))
ready = input('Ok! (q to quit, enter to continue):')
if ready == 'q':
break
ready_steady()
Aucun commentaire:
Enregistrer un commentaire