Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions wk7 - assignment 7.1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
You can download the sample data at http://www.pythonlearn.com/code/words.txt

# Use words.txt as the file name
fname = raw_input("Enter file name: ")
# Use words.txt as the file name
fname = input("Enter file data: ")
fh = open(fname)

for line in fh:
line = line.rstrip()
line = line.upper()
print(line)

for line in fh.readlines():
print (line.upper().strip())