Skip to content

Commit 60cdf23

Browse files
authored
Create ch07_hw1.py
1 parent 459d05d commit 60cdf23

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Chapter Seven: Files/ch07_hw1.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
print('Exercise 1: Write a program to read through a file and '
2+
'print the contents of the file (line by line) all in upper case.')
3+
fname = open ('mbox.txt')
4+
for line in fname:
5+
line = line.rstrip()
6+
print(line.upper())

0 commit comments

Comments
 (0)