I need to define a function that opens a text file, reads it, then loads the entire file into a string. This is what I have so far:
def encrypt_file(filename):
open_file = open(filename, 'r')
file_content = filename.read()
filename.close()
encrypt_file(filename)
user_input = input('enter file name: ')
This is the error I get:
encrypt_file(filename)
NameError: name 'filename' is not defined
What am I doing wrong here?