Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2865873

Browse files
Create Assignment 8.5.py
1 parent 6d53e3e commit 2865873

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎Assignment 8.5.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
filename = input("Enter file name: ")
2+
fileholder = open(filename)
3+
count = 0
4+
for line in fileholder:
5+
nline = line.rstrip()
6+
if 'From' in nline and'From:' not in nline:
7+
lsplit = nline.split()
8+
print(lsplit[1])
9+
else:
10+
continue
11+
count += 1
12+
print("There were", count, "lines in the file with From as the first word")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /