Dec-12-2021, 09:10 PM
(Dec-12-2021, 08:54 PM)snippsat Wrote: A more normal and standard way to do this menator01.
import random class Word: def __init__(self, word_list): self.word_list = word_list def get_word(self): words = random.choice(self.word_list) return words word_list = ['a', 'ranom', 'list', 'of', 'words'] word = Word(word_list) for w in range(5): print(word.get_word())
Output:words of of ranom words
This is what I need to study and wrap my head around.