Write a program that opens the my_name.txt file that was created by the program in problem 1, reads your name from the file, displays the name on the screen, then closes the file.

Respuesta :

Answer:

#using python

def main ():

infile=open(‘my_name.txt’, ‘r’)

#using read method to read file contents

File_contents=infile.read()

#close

infile.close()

#display

print(file_contents)

#finally call main method()

main()

ACCESS MORE