diff --git a/TEMA6/text.txt b/TEMA6/text.txt index f1bfe15..915c2c9 100644 --- a/TEMA6/text.txt +++ b/TEMA6/text.txt @@ -1,359 +1,400 @@ -Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32 -Type "help", "copyright", "credits" or "license()" for more information. -stroka='Автоматизированная система управления' -stroka -'Автоматизированная система управления' -fff=234.5;gg='Значение температуры = ' -print(gg, fff) -Значение температуры = 234.5 -print(gg, fff, sep='/') -Значение температуры = /234.5 -print(gg, fff,sep='/',end='***'); print('____') -Значение температуры = /234.5***____ -print() - -print(""" Здесь может выводиться -большой текст, -занимающий несколько строк""") - Здесь может выводиться -большой текст, -занимающий несколько строк -print("Здесь может выводиться", - "большой текст,", - "занимающий несколько строк") -Здесь может выводиться большой текст, занимающий несколько строк -import sys -sys.stdout.write('Функция write') -Функция write13 -sys.stdout.write('Функция write') -Функция write13 -sys.stdout.write('Функция write\n') -Функция write -14 -psw=input('Введите пароль:') -Введите пароль:a -psw -'a' -type(psw) - -while True: - znach=float(input('Задайте коэф.усиления = ')) - if znach<17.5 or znach>23.8: - print('Ошибка!') - else: - break - -SyntaxError: inconsistent use of tabs and spaces in indentation -while True: - znach=float(input('Задайте коэф.усиления = ')) - if znach<17.5 or znach>23.8: - print('Ошибка!') - else: - break - - -Задайте коэф.усиления = 15.4 -Ошибка! -Задайте коэф.усиления = 21.6 -import math -print(eval(input('введите выражение для расчета = '))) -введите выражение для расчета = math.log10(23/(1+math.exp(-3.24))) -1.34504378689765 -import os -os.chdir('L:\\III курс\\А-3-23\\Korneev') -os.getcwd() -'L:\\III курс\\А-3-23\\Korneev' -korneev = os.getcwd() -print(korneev) -L:\III курс\А-3-23\Korneev -help(os.mkdir) -Help on built-in function mkdir in module nt: - -mkdir(path, mode=511, *, dir_fd=None) - Create a directory. - - If dir_fd is not None, it should be a file descriptor open to a directory, - and path should be relative; path will then be relative to that directory. - dir_fd may not be implemented on your platform. - If it is unavailable, using it will raise a NotImplementedError. - - The mode argument is ignored on Windows. Where it is used, the current umask - value is first masked out. - -os.mkdir() -Traceback (most recent call last): - File "", line 1, in - os.mkdir() -TypeError: mkdir() missing required argument 'path' (pos 1) -os.mkdir('a') -help(os.rmdir) -Help on built-in function rmdir in module nt: - -rmdir(path, *, dir_fd=None) - Remove a directory. - - If dir_fd is not None, it should be a file descriptor open to a directory, - and path should be relative; path will then be relative to that directory. - dir_fd may not be implemented on your platform. - If it is unavailable, using it will raise a NotImplementedError. - -os.rmdir('a') -os.listdir() -['Lab Raboty IT', 'poas', 'shemotehnika', 'vichmetod'] -help(os.path.isdir) -Help on function isdir in module genericpath: - -isdir(s) - Return true if the pathname refers to an existing directory. - -os.path.isdir('poas') -True -fil=os.path.abspath("oplata.dbf") -fil -'L:\\III курс\\А-3-23\\Korneev\\oplata.dbf' -fil=os.path.abspath("text.txt") -fil -'L:\\III курс\\А-3-23\\Korneev\\text.txt' -drkt=os.path.dirname(fil) -drkt -'L:\\III курс\\А-3-23\\Korneev' -os.path.basename(fil) -'text.txt' -help(os.path.split) -Help on function split in module ntpath: - -split(p) - Split a pathname. - - Return tuple (head, tail) where tail is everything after the final slash. - Either part may be empty. - -os.path.split(fil) -('L:\\III курс\\А-3-23\\Korneev', 'text.txt') -os.path.exists(fil) -True -os.path.exists('L:\\III курс\\А-3-23\\Korneev\\hello.txt') -False -os.path.isfile(fil) -True -fp=open(file=drkt+'\\text.txt',mode='w') -type(fp) - -dir(fp) -['_CHUNK_SIZE', '__class__', '__del__', '__delattr__', '__dict__', '__dir__', '__doc__', '__enter__', '__eq__', '__exit__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__lt__', '__ne__', '__new__', '__next__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_checkClosed', '_checkReadable', '_checkSeekable', '_checkWritable', '_finalizing', 'buffer', 'close', 'closed', 'detach', 'encoding', 'errors', 'fileno', 'flush', 'isatty', 'line_buffering', 'mode', 'name', 'newlines', 'read', 'readable', 'readline', 'readlines', 'reconfigure', 'seek', 'seekable', 'tell', 'truncate', 'writable', 'write', 'write_through', 'writelines'] -fp1=open(drkt+'\\zapis2.bin',mode='wb+') -fp.close() -fpl.close() -Traceback (most recent call last): - File "", line 1, in - fpl.close() -NameError: name 'fpl' is not defined. Did you mean: 'fil'? -fp1.close() -sps=list(range(1,13)) -fp2=open('zapis3.txt','w') -fp2.write(str(sps[:4])+'\n') -13 -fp2.write(str(sps[4:8])+'\n') -13 -fp2.write(str(sps[8:])+'\n') -16 -fp2.close() -sps3=[['Иванов И.',1],['Петров П.',2],['Сидоров С.',3]] -fp3=open('zapis4.txt','w') -for i in range(len(sps3)): - stroka4=sps3[i][0]+' '+str(sps3[i][1])fp3.write(stroka4) - -SyntaxError: invalid syntax -for i in range(len(sps3)): - stroka4=sps3[i][0]+' '+str(sps3[i][1])fp3.write(stroka4) - -SyntaxError: invalid syntax -for i in range(len(sps3)): - stroka4=sps3[i][0]+' '+str(sps3[i][1]) - fp3.write(stroka4) - - -11 -11 -12 -fp3.close() -gh=open('zapis5.txt','w') -for r in sps3: - gh.write(r[0]+' '+str(r[1])+'\n') - - -12 -12 -13 -gh.close() -sps1=[] -fp=open('zapis3.txt') -for stroka in fp: - stroka=stroka.rstrip('\n') - stroka=stroka.replace('[','') - stroka=stroka.replace(']','') - sps1=sps1+stroka.split(',') - - -fp.close() -stroka -'9, 10, 11, 12' -sps -[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] -sps1 -['1', ' 2', ' 3', ' 4', '5', ' 6', ' 7', ' 8', '9', ' 10', ' 11', ' 12'] -for stroka in fp: - stroka=stroka.rstrip('\n') - stroka=stroka.replace('[','') - stroka=stroka.replace(']','') - stroka=stroka.replace(' ','') - sps2=stroka.split(',') - for i in sps2: - sps1 = sps1 + int(i) - - -Traceback (most recent call last): - File "", line 1, in - for stroka in fp: -ValueError: I/O operation on closed file. -fp=open('zapis3.txt') -for stroka in fp: - stroka=stroka.rstrip('\n') - stroka=stroka.replace('[','') - stroka=stroka.replace(']','') - stroka=stroka.replace(' ','') - sps2=stroka.split(',') - for i in sps2: - sps1 = sps1 + int(i) - - -Traceback (most recent call last): - File "", line 8, in - sps1 = sps1 + int(i) -TypeError: can only concatenate list (not "int") to list -for stroka in fp: - stroka=stroka.rstrip('\n') - stroka=stroka.replace('[','') - stroka=stroka.replace(']','') - stroka=stroka.replace(' ','') - sps2=stroka.split(',') - for i in sps2: - sps1 = sps1 + [int(i)] - - -sps1 -['1', ' 2', ' 3', ' 4', '5', ' 6', ' 7', ' 8', '9', ' 10', ' 11', ' 12', 5, 6, 7, 8, 9, 10, 11, 12] -sps1=[] -for stroka in fp: - stroka=stroka.rstrip('\n') - stroka=stroka.replace('[','') - stroka=stroka.replace(']','') - stroka=stroka.replace(' ','') - sps2=stroka.split(',') - for i in sps2: - sps1 = sps1 + [int(i)] - - -fp.close() -sps1 -[] -fp=open('zapis3.txt') -for stroka in fp: - stroka=stroka.rstrip('\n') - stroka=stroka.replace('[','') - stroka=stroka.replace(']','') - stroka=stroka.replace(' ','') - sps2=stroka.split(',') - for i in sps2: - sps1 = sps1 + [int(i)] - - -sps1 -[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] -fp.close() -sps1 -[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] -sps2 -['9', '10', '11', '12'] -sps -[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] -fp=open('zapis3.txt') -stroka1=fp.read(12) -stroka2=fp.read() -fp.close() -stroka1 -'[1, 2, 3, 4]' -stroka -'9,10,11,12' -fp=open('zapis3.txt') -stroka3=fp.readline() -stroka4=fp.readlines() -fp.close() -stroka3 -'[1, 2, 3, 4]\n' -stroka4 -['[5, 6, 7, 8]\n', '[9, 10, 11, 12]\n'] -import pickle - -mnoz1={'pen','book','pen','iPhone','table','book'} -fp=open('zapis6.mnz','wb') -pickle.dump(mnoz1,fp) -fp.close() -fp=open('zapis6.mnz','rb') -mnoz2=pickle.load(fp) -fp.close() -mnoz1 -{'iPhone', 'pen', 'table', 'book'} -mnoz2 -{'iPhone', 'pen', 'table', 'book'} -mnoz1 is mnoz2 -False -fp=open('zapis7.2ob','wb') -pickle.dump(mnoz1,fp) -pickle.dump(sps3,fp) -fp.close() -fp=open('zapis7.2ob','rb') -obj1=pickle.load(fp) -obj2=pickle.load(fp) -fp.close() -obj1 -{'iPhone', 'pen', 'table', 'book'} -mnoz1 -{'iPhone', 'pen', 'table', 'book'} -obj2 -[['Иванов И.', 1], ['Петров П.', 2], ['Сидоров С.', 3]] -sps3 -[['Иванов И.', 1], ['Петров П.', 2], ['Сидоров С.', 3]] -mnoz1 is obj1 -False -mnoz1 == obj1 -True -mnoz1 == mnoz2 -True -sps3 == obj2 -True -import sys -vr_out=sys.stdout -fc=open('Stroka.txt','w') -sys.stdout=fc -print('запись строки в файл') -sys.stdout=vr_out -print('запись строки на экран') -запись строки на экран -fc.close() -tmp_in = sys.stdin -fd = open("Stroka.txt", "r") -sys.stdin = fd -sys.stdin -<_io.TextIOWrapper name='Stroka.txt' mode='r' encoding='cp1251'> -while True: - try: - line = input () - print(line) - except EOFError: - break - - -запись строки в файл -fd.close() -sys.stdin=tmp_in +Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32 +Type "help", "copyright", "credits" or "license()" for more information. +stroka='Автоматизированная система управления' +stroka +'Автоматизированная система управления' +fff=234.5;gg='Значение температуры = ' +print(gg, fff) +Значение температуры = 234.5 +print(gg, fff, sep='/') +Значение температуры = /234.5 +print(gg, fff,sep='/',end='***'); print('____') +Значение температуры = /234.5***____ +print() + +print(""" Здесь может выводиться +большой текст, +занимающий несколько строк""") + Здесь может выводиться +большой текст, +занимающий несколько строк +print("Здесь может выводиться", + "большой текст,", + "занимающий несколько строк") +Здесь может выводиться большой текст, занимающий несколько строк +import sys +sys.stdout.write('Функция write') +Функция write13 +sys.stdout.write('Функция write') +Функция write13 +sys.stdout.write('Функция write\n') +Функция write +14 +psw=input('Введите пароль:') +Введите пароль:a +psw +'a' +type(psw) + +while True: + znach=float(input('Задайте коэф.усиления = ')) + if znach<17.5 or znach>23.8: + print('Ошибка!') + else: + break + +SyntaxError: inconsistent use of tabs and spaces in indentation +while True: + znach=float(input('Задайте коэф.усиления = ')) + if znach<17.5 or znach>23.8: + print('Ошибка!') + else: + break + + +Задайте коэф.усиления = 15.4 +Ошибка! +Задайте коэф.усиления = 21.6 +import math +print(eval(input('введите выражение для расчета = '))) +введите выражение для расчета = math.log10(23/(1+math.exp(-3.24))) +1.34504378689765 +import os +os.chdir('L:\\III курс\\А-3-23\\Korneev') +os.getcwd() +'L:\\III курс\\А-3-23\\Korneev' +korneev = os.getcwd() +print(korneev) +L:\III курс\А-3-23\Korneev +help(os.mkdir) +Help on built-in function mkdir in module nt: + +mkdir(path, mode=511, *, dir_fd=None) + Create a directory. + + If dir_fd is not None, it should be a file descriptor open to a directory, + and path should be relative; path will then be relative to that directory. + dir_fd may not be implemented on your platform. + If it is unavailable, using it will raise a NotImplementedError. + + The mode argument is ignored on Windows. Where it is used, the current umask + value is first masked out. + +os.mkdir() +Traceback (most recent call last): + File "", line 1, in + os.mkdir() +TypeError: mkdir() missing required argument 'path' (pos 1) +os.mkdir('a') +help(os.rmdir) +Help on built-in function rmdir in module nt: + +rmdir(path, *, dir_fd=None) + Remove a directory. + + If dir_fd is not None, it should be a file descriptor open to a directory, + and path should be relative; path will then be relative to that directory. + dir_fd may not be implemented on your platform. + If it is unavailable, using it will raise a NotImplementedError. + +os.rmdir('a') +os.listdir() +['Lab Raboty IT', 'poas', 'shemotehnika', 'vichmetod'] +help(os.path.isdir) +Help on function isdir in module genericpath: + +isdir(s) + Return true if the pathname refers to an existing directory. + +os.path.isdir('poas') +True +fil=os.path.abspath("oplata.dbf") +fil +'L:\\III курс\\А-3-23\\Korneev\\oplata.dbf' +fil=os.path.abspath("text.txt") +fil +'L:\\III курс\\А-3-23\\Korneev\\text.txt' +drkt=os.path.dirname(fil) +drkt +'L:\\III курс\\А-3-23\\Korneev' +os.path.basename(fil) +'text.txt' +help(os.path.split) +Help on function split in module ntpath: + +split(p) + Split a pathname. + + Return tuple (head, tail) where tail is everything after the final slash. + Either part may be empty. + +os.path.split(fil) +('L:\\III курс\\А-3-23\\Korneev', 'text.txt') +os.path.exists(fil) +True +os.path.exists('L:\\III курс\\А-3-23\\Korneev\\hello.txt') +False +os.path.isfile(fil) +True +fp=open(file=drkt+'\\text.txt',mode='w') +type(fp) + +dir(fp) +['_CHUNK_SIZE', '__class__', '__del__', '__delattr__', '__dict__', '__dir__', '__doc__', '__enter__', '__eq__', '__exit__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__lt__', '__ne__', '__new__', '__next__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_checkClosed', '_checkReadable', '_checkSeekable', '_checkWritable', '_finalizing', 'buffer', 'close', 'closed', 'detach', 'encoding', 'errors', 'fileno', 'flush', 'isatty', 'line_buffering', 'mode', 'name', 'newlines', 'read', 'readable', 'readline', 'readlines', 'reconfigure', 'seek', 'seekable', 'tell', 'truncate', 'writable', 'write', 'write_through', 'writelines'] +fp1=open(drkt+'\\zapis2.bin',mode='wb+') +fp.close() +fpl.close() +Traceback (most recent call last): + File "", line 1, in + fpl.close() +NameError: name 'fpl' is not defined. Did you mean: 'fil'? +fp1.close() +sps=list(range(1,13)) +fp2=open('zapis3.txt','w') +fp2.write(str(sps[:4])+'\n') +13 +fp2.write(str(sps[4:8])+'\n') +13 +fp2.write(str(sps[8:])+'\n') +16 +fp2.close() +sps3=[['Иванов И.',1],['Петров П.',2],['Сидоров С.',3]] +fp3=open('zapis4.txt','w') +for i in range(len(sps3)): + stroka4=sps3[i][0]+' '+str(sps3[i][1])fp3.write(stroka4) + +SyntaxError: invalid syntax +for i in range(len(sps3)): + stroka4=sps3[i][0]+' '+str(sps3[i][1])fp3.write(stroka4) + +SyntaxError: invalid syntax +for i in range(len(sps3)): + stroka4=sps3[i][0]+' '+str(sps3[i][1]) + fp3.write(stroka4) + + +11 +11 +12 +fp3.close() +gh=open('zapis5.txt','w') +for r in sps3: + gh.write(r[0]+' '+str(r[1])+'\n') + + +12 +12 +13 +gh.close() +sps1=[] +fp=open('zapis3.txt') +for stroka in fp: + stroka=stroka.rstrip('\n') + stroka=stroka.replace('[','') + stroka=stroka.replace(']','') + sps1=sps1+stroka.split(',') + + +fp.close() +stroka +'9, 10, 11, 12' +sps +[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] +sps1 +['1', ' 2', ' 3', ' 4', '5', ' 6', ' 7', ' 8', '9', ' 10', ' 11', ' 12'] +for stroka in fp: + stroka=stroka.rstrip('\n') + stroka=stroka.replace('[','') + stroka=stroka.replace(']','') + stroka=stroka.replace(' ','') + sps2=stroka.split(',') + for i in sps2: + sps1 = sps1 + int(i) + + +Traceback (most recent call last): + File "", line 1, in + for stroka in fp: +ValueError: I/O operation on closed file. +fp=open('zapis3.txt') +for stroka in fp: + stroka=stroka.rstrip('\n') + stroka=stroka.replace('[','') + stroka=stroka.replace(']','') + stroka=stroka.replace(' ','') + sps2=stroka.split(',') + for i in sps2: + sps1 = sps1 + int(i) + + +Traceback (most recent call last): + File "", line 8, in + sps1 = sps1 + int(i) +TypeError: can only concatenate list (not "int") to list +for stroka in fp: + stroka=stroka.rstrip('\n') + stroka=stroka.replace('[','') + stroka=stroka.replace(']','') + stroka=stroka.replace(' ','') + sps2=stroka.split(',') + for i in sps2: + sps1 = sps1 + [int(i)] + + +sps1 +['1', ' 2', ' 3', ' 4', '5', ' 6', ' 7', ' 8', '9', ' 10', ' 11', ' 12', 5, 6, 7, 8, 9, 10, 11, 12] +sps1=[] +for stroka in fp: + stroka=stroka.rstrip('\n') + stroka=stroka.replace('[','') + stroka=stroka.replace(']','') + stroka=stroka.replace(' ','') + sps2=stroka.split(',') + for i in sps2: + sps1 = sps1 + [int(i)] + + +fp.close() +sps1 +[] +fp=open('zapis3.txt') +for stroka in fp: + stroka=stroka.rstrip('\n') + stroka=stroka.replace('[','') + stroka=stroka.replace(']','') + stroka=stroka.replace(' ','') + sps2=stroka.split(',') + for i in sps2: + sps1 = sps1 + [int(i)] + + +sps1 +[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] +fp.close() +sps1 +[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] +sps2 +['9', '10', '11', '12'] +sps +[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] +fp=open('zapis3.txt') +stroka1=fp.read(12) +stroka2=fp.read() +fp.close() +stroka1 +'[1, 2, 3, 4]' +stroka +'9,10,11,12' +fp=open('zapis3.txt') +stroka3=fp.readline() +stroka4=fp.readlines() +fp.close() +stroka3 +'[1, 2, 3, 4]\n' +stroka4 +['[5, 6, 7, 8]\n', '[9, 10, 11, 12]\n'] +import pickle + +mnoz1={'pen','book','pen','iPhone','table','book'} +fp=open('zapis6.mnz','wb') +pickle.dump(mnoz1,fp) +fp.close() +fp=open('zapis6.mnz','rb') +mnoz2=pickle.load(fp) +fp.close() +mnoz1 +{'iPhone', 'pen', 'table', 'book'} +mnoz2 +{'iPhone', 'pen', 'table', 'book'} +mnoz1 is mnoz2 +False +fp=open('zapis7.2ob','wb') +pickle.dump(mnoz1,fp) +pickle.dump(sps3,fp) +fp.close() +fp=open('zapis7.2ob','rb') +obj1=pickle.load(fp) +obj2=pickle.load(fp) +fp.close() +obj1 +{'iPhone', 'pen', 'table', 'book'} +mnoz1 +{'iPhone', 'pen', 'table', 'book'} +obj2 +[['Иванов И.', 1], ['Петров П.', 2], ['Сидоров С.', 3]] +sps3 +[['Иванов И.', 1], ['Петров П.', 2], ['Сидоров С.', 3]] +mnoz1 is obj1 +False +mnoz1 == obj1 +True +mnoz1 == mnoz2 +True +sps3 == obj2 +True +import sys +vr_out=sys.stdout +fc=open('Stroka.txt','w') +sys.stdout=fc +print('запись строки в файл') +sys.stdout=vr_out +print('запись строки на экран') +запись строки на экран +fc.close() +tmp_in = sys.stdin +fd = open("Stroka.txt", "r") +sys.stdin = fd +sys.stdin +<_io.TextIOWrapper name='Stroka.txt' mode='r' encoding='cp1251'> +while True: + try: + line = input () + print(line) + except EOFError: + break + + +запись строки в файл +fd.close() +sys.stdin=tmp_in +fp = open('file.py', 'w') +import random +kort = tuple(random.randint(6,56)) +Traceback (most recent call last): + File "", line 1, in + kort = tuple(random.randint(6,56)) +TypeError: 'int' object is not iterable +kort = tuple(random.randint(6,56) for _ in range(125)) +kort +(38, 22, 36, 14, 32, 26, 6, 17, 40, 48, 10, 49, 26, 39, 32, 32, 6, 55, 50, 9, 51, 20, 47, 10, 54, 10, 27, 54, 47, 27, 21, 15, 22, 43, 42, 40, 55, 34, 46, 50, 51, 29, 43, 21, 10, 35, 26, 13, 47, 10, 54, 54, 20, 56, 18, 35, 11, 22, 43, 56, 47, 28, 8, 32, 37, 36, 54, 43, 47, 49, 49, 18, 41, 21, 40, 6, 38, 18, 39, 47, 18, 34, 23, 18, 41, 39, 33, 34, 37, 46, 50, 51, 10, 38, 9, 15, 34, 47, 7, 50, 7, 7, 6, 56, 53, 26, 15, 16, 15, 20, 23, 15, 37, 9, 27, 29, 20, 9, 53, 12, 6, 27, 35, 22, 24) +spis=['Корнеев', 'Немецкий', 'Гордиевских', 'Огарков', 'Васильев'] +fp.close() +fp = open('file.py', 'wb') +fp.write(kort) +Traceback (most recent call last): + File "", line 1, in + fp.write(kort) +TypeError: a bytes-like object is required, not 'tuple' +pickle.dump(kort,fp) +pickle.dump(spis,fp) +fp.close() +fp = open('file.py') +obj1=pickle.load(fp) +Traceback (most recent call last): + File "", line 1, in + obj1=pickle.load(fp) +TypeError: a bytes-like object is required, not 'str' +fp.close() +fp = open('file.py', 'rb') +obj1=pickle.load(fp) +obj2=pickle.load(fp) +if obj1 == kort: + print('Объекты совпадают') +else: print('Объекты не совпадают') + +Объекты совпадают +if obj2 == spis: + print('Объекты совпадают') +else: print('Объекты не совпадают') + +Объекты совпадают