Like in title i made program with check if in text lines are doubled words And in the end shown number of lines without doubled words.
this is example text:
sayndz zfxlkl attjtww cti sokkmty brx fhh suelqbp xmuf znkhaes pggrlp zia znkhaes znkhaes nti rxr bogebb zdwrin sryookh unrudn zrkz jxhrdo zrkz bssqn wbmdc rigc zketu ketichh enkixg bmdwc stnsdf jnz mqovwg ixgken
I already made program, and It looks that program works. But I’m aware that in programming if something work it doesn’t mean that program is made properly.
class SkyphrasesValidation(object): def get_text_file(self): file = open('C:/Users/PC/Documents/skychallenge_skyphrase_input.txt', 'r') return file def lines_list(self): text = self.get_text_file() line_list = text.readlines() return [line.split() for line in line_list] def phrases_validation(self): validated_phrases = 0 for line in self.lines_list(): new_line =  for word in line: exam = line.count(word) if exam > 1: new_line.append(0) else: new_line.append(1) if 0 in new_line: validated_phrases += 0 else: validated_phrases += 1 return validated_phrases def __str__(self): return str(self.phrases_validation()) text = SkyphrasesValidation() print(text)
Is my logic is good and this program is well made or maybe it looks like poop and I could make this more cleary.