Python/Lab_5/Namelist.py

9 lines
198 B
Python

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)