Python/Lab_5/Namelist.py

9 lines
198 B
Python
Raw Normal View History

2024-03-09 17:38:18 +02:00
from random import sample, randint
with open("list.txt") as surnames_list:
surnames = surnames_list.read().splitlines()
surnames = sample(surnames, randint(5, len(surnames)))
print(surnames)