Why this is not working? Showing no output. file can open and there are words without e in file too. | SoloLearn: Learn to code for FREE!

0

Why this is not working? Showing no output. file can open and there are words without e in file too.

def no_e(word): if 'e' in word: return True else: return False file= open('words.txt') for line in file: line=line.strip() if no_e(line)==True: print(line)

5/12/2020 3:23:08 PM

Neeraj Agarwal

3 Answers

New Answer

+2

Neeraj Agarwal No here it will not give error. Just file will return null.

+1

Neeraj Agarwal Because file doesn't exist.

0

Then it will show error that file or directory is not available