Skip to content
Snippets Groups Projects
Commit a5afa024 authored by Danny McDonald's avatar Danny McDonald
Browse files

use f-string consistently!

parent 54c19b78
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,7 @@ def wordcount(filepath): ...@@ -58,7 +58,7 @@ def wordcount(filepath):
# perform the counting using the Counter class # perform the counting using the Counter class
counted = Counter(cleaned) counted = Counter(cleaned)
# print top 10 most frequent # print top 10 most frequent
print("Counts:\n\n", counted.most_common(10), "\n\n") print(f"Counts:\n\n{counted.most_common(10)}\n\n")
# return the wordcount data to us after we call this function # return the wordcount data to us after we call this function
return counted return counted
......
...@@ -49,7 +49,7 @@ def wordcount(filepath): ...@@ -49,7 +49,7 @@ def wordcount(filepath):
# perform the counting using the Counter class # perform the counting using the Counter class
counted = Counter(cleaned) counted = Counter(cleaned)
# print top 10 most frequent # print top 10 most frequent
print("Counts:\n\n", counted.most_common(10), "\n\n") print(f"Counts:\n\n{counted.most_common(10)}\n\n")
# return the wordcount data to us after we call this function # return the wordcount data to us after we call this function
return counted return counted
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment