Question: Python CMSC 206 Can you fix this code ASAP, please??? file = input(Enter a file name: ) lines = open(file) cnt = 0 for line
Python CMSC 206
Can you fix this code ASAP, please???
file = input("Enter a file name: ") lines = open(file) cnt = 0 for line in lines: sp = line.split(" ") if sp[0] == "From": print(sp[1]) ++cnt print("There were " + str(cnt) + " lines in the file with From as the first word")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
