add sinonims for dick and def random word from dict

This commit is contained in:
Pavel_Duron
2022-12-16 19:19:23 +10:00
parent adcf425183
commit 157833e41a
3 changed files with 89 additions and 0 deletions

13
dicktxt/ForReadDict.py Normal file
View File

@@ -0,0 +1,13 @@
import random
def RandomDick():
with open('tests\diction.txt', 'r', encoding='utf-8') as file:
words = file.readlines()
random_line = random.choice(words).strip()
return random_line
random_line = RandomDick()