Question: using the following instructions write the code in python: Outline the program a ) Define the three functions: get _ filename ( ) , process
using the following instructions write the code in python:
Outline the program
a Define the three functions:
getfilename processfile
and main
b Call main at the bottom just put
main on the first indent
def getfilename:
a Use input to ask for filename and
store into variable filename
b Return variable
def processfile:
a openfilenamer encoding'utf
b Create articlecount variable
c For line in file:
If the line starts with URL line:URL
Increment articlecount
Print out Article: #
Print out the line with the URL
d Close the file
e Print out A total of # articles were found!
def main:
a Call getfilename and store it to a variable
b Call processfilevariablename
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
