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:
get_filename(), process_file(),
and main()
b) Call main at the bottom (just put
main() on the first indent)
2. def get_filename():
a) Use input to ask for filename and
store into variable (filename)
b) Return variable
3. def process_file():
a) open(filename,'r', encoding='utf-8)
b) Create article_count variable
c) For line in file:
If the line starts with URL (line[0:3]==URL)
Increment article_count
Print out Article: #
Print out the line with the URL
d) Close the file
e) Print out A total of # articles were found!
4. def main():
a) Call get_filename() and store it to a variable
b) Call process_file(variable_name

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!