from random import randint from pickle import dump, load from os import chdir chdir('/Users/vatarishin/lab_sem_5/python-labs/TEMA6') intTuple = () for _ in range(125): intTuple + (str(randint(6, 56)), ) surnames = ['Kovalenko', 'Hoduyk', 'Ivanov', 'Mahnov'] with open('bin_task.bin', mode='wb') as file: dump(intTuple, file) dump(surnames, file) with open('bin_task.bin', mode='rb') as file: binObj1 = load(file) binObj2 = load(file) print(f'tuples are indentical: {binObj1 == intTuple}\nlists are indentical: {surnames == binObj2}')