Write a program that prompts for a file name, then opens that file and reads through the file, and print the contents of the file in upper case. Use the file words.txt to produce the output below.
You can download the sample data at http://www.pythonlearn.com/code/words.txt
I assume, that you have downloaded the above file in the default folder from where your python interpreter or IDE runs.
# Use “words.txt” as the file name : This will read the file name as string, into memory.
fname = raw_input(“Enter file name: “)
# open downloaded file from default location
fh = open(fname)
# read the content of the file
inp = fh.read()
# Convert all the letters in the content of the file into Upper Case
inp = inp.upper()
# Print the content after removing the double/white and double lines space