Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inp = input("Enter file name: ")
- try:
- count = 0
- holder = open(inp, "r")
- for line in holder:
- if line.startswith("From:"):
- line = line.rstrip()
- adress = line.split()
- print(adress[1])
- count = count + 1
- else:
- continue
- print("There were", count, "lines in the file with From as the first word")
- except:
- print("Not equal name")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement