Displaying a File

Ask the user for the name of a file to open. Open that file, and display the entire contents of the file on the screen.

You should use a for loop to process one line at a time from the file. Just like a for loop can look at all the values in a list, you can use it to "loop" through the lines in a file.

Open which file: score.txt
Mitchell
32767

The file you display should look the same on the screen as it would if you viewed it in Notepad or something, with all spaces and newlines intact and with no extra blank lines.

Open which file: receipt.txt
+------------------------+
|                        |
|      CORNER STORE      |
|                        |
| 2017-02-18  04:38PM    |
|                        |
| Gallons:       12.464  |
| Price/gallon: $ 3.459  |
|                        |
| Fuel total:  $ 43.11   |
|                        |
+------------------------+



©2017 Graham Mitchell