У меня есть этот код:открытие с дубликатами
chain = '>'
contain=''
file = raw_input('Enter your filename : ')
fileName = open(file,'r')
for line in fileName:
\t if chain in line :
\t \t pass
\t \t \t
\t if not(chain in line):
\t \t contain+=line
\t \t print contain
\t \t
fileName.close()
и этот file.txt:
Python supports multiple programming paradigms, including object-oriented, imperative and functional programming.
It features a dynamic type system and automatic memory management.
He has a large and comprehensive standard library
Я получил этот результат для "печати":
Python supports multiple programming paradigms, including object-oriented, imperative and functional programming.
Python supports multiple programming paradigms, including object-oriented, imperative and functional programming.
It features a dynamic type system and automatic memory management.
Python supports multiple programming paradigms, including object-oriented, imperative and functional programming.
It features a dynamic type system and automatic memory management.
He has a large and comprehensive standard library
Почему у меня есть дубликаты?
Цепочка может быть только в линии или нет, ваши два ifs избыточны –
да. Я буду как больше условий позже – yokie