def main(): import random words = ['Слово0', "Слово1", "Слово2", "Слово3", "Слово4", "Слово5"] tries = 0 x = 6 while True: random_choice = random.randrange(x) print(words[random_choice]) del words[random_choice] x -= 1 random_choice = random.randrange(x) tries += 1 if tries > 5: break
Traceback (most recent call last):
File “C:\Python31\test.py”, line 11, in <module>
random_choice = random.randrange(x)
File “C:\Python31\lib\random.py”, line 174, in randrange
raise ValueError(“empty range for randrange()”)
ValueError: empty range for randrange()
Как сделать так, чтобы он не выводил ошибки?