Answers for "You will be passed a file path P and string S on the command line. Output the number of times the string S appears in the file P."

0

You will be passed a file path P and string S on the command line. Output the number of times the string S appears in the file P.

You will be passed a file path P and string S on the command line. Output the number of times the string S appears in the file P.

file = open(P, 'r')
ptext = file.read()
print(ptext.count(S))
file.close()
Posted by: Guest on February-12-2020

Code answers related to "You will be passed a file path P and string S on the command line. Output the number of times the string S appears in the file P."

Python Answers by Framework

Browse Popular Code Answers by Language