PYTHON: Write a program that takes a keyword and one or more
file names on the command line. Then for each file specified by
each filename, print out every line that contains the keyword --
following the format shown below.
E.g.,
% python find.py Foobar report.txt address.txt
homework.py
might result in the following output:
report.txt: an international ring of Foobar bootleggers
address.
txt: Foobar Leitner, Cambridge MA address.
txt: Foobar Industries, North Pole
homework.py: String filename = “Foobar.fum”
Note that the special word being search for is always the
first command line argument.
PYTHON: Write a program that takes a keyword and one or more file names on the command line. Then for each file specifie
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
PYTHON: Write a program that takes a keyword and one or more file names on the command line. Then for each file specifie
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!