with open('speech.txt') as f: for i in f: i = i.rstrip() line = input('line: ') if line == 'LINE!': print('{}'.format(i.rstrip())) elif line != i: print('No! {}'.format(i.rstrip())) print('Good!')
I'm sure this will help me revising for exams or something in the future!!!