def find(): a = raw_input("Insert file: ") b = raw_input("Insert pattern: ") try: found = 0 for i in open(a, 'r'): if b in i: found = 1 if found == 1: print "Patter was found." else: print "Pattern not found." except: print "Invalid file." find()
Edited by snippsat
Are you able to help answer this sponsored question?
Questions asked by members who have earned a lot of community kudos are featured in order to give back and encourage quality replies.