removed open_book arg

This commit is contained in:
specCon18 2025-01-09 22:22:55 -05:00
parent df434df398
commit 51fb1dce98

10
main.py
View file

@ -1,8 +1,8 @@
import sys import sys
import string import string
def open_book(book_path): def open_book():
with open(book_path) as f: with open(sys.argv[1]) as f:
file_contents = f.read() file_contents = f.read()
return file_contents return file_contents
@ -29,7 +29,7 @@ def print_report(word_count,char_count):
for char in chars: for char in chars:
print(f"The '{char}' character was found {char_count.get(char)} times") print(f"The '{char}' character was found {char_count.get(char)} times")
print("--- End report ---") print("--- End report ---")
book = sys.argv[1]
wc = count_words(open_book(book)) wc = count_words(open_book())
cc = count_char_instance(open_book(book)) cc = count_char_instance(open_book())
print_report(wc,cc) print_report(wc,cc)