I have the below function which asks the user for a file and then returns the lines in that file (excluding the lines that contain a -
symbol).
However I have an error with the function. While it does ask for input, this is not passed into the function. Would anyone be able to help me with where I went wrong? Thank you
filename = input('input the filename: ')
def read_from_file(filename):
with open(filename) as file:
content = [line for line in file if '-' not in line]
return content