Content-Length: 257795 | pFad | http://github.com/unrealapex/python-programming/commit/b4d114fbae7d4f01ca86674dfafdeb5621c356e5

4E Singlular and plural wording condition · unrealapex/python-programming@b4d114f · GitHub
Skip to content

Commit b4d114f

Browse files
committed
Singlular and plural wording condition
1 parent b28445f commit b4d114f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lab-12/occurance-remover.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ def occurance_remover(file_path, removal_string):
1212
with open(file_path, 'w') as file:
1313
file.write(filedata)
1414
file.close()
15-
print(f"Removed {occurances} occurances of {removal_string} from {os.path.basename(file_path)}")
15+
print(f"Removed {occurances} {'occurances' if (occurances != 1) else 'occurance'} of {removal_string} from {os.path.basename(file_path)}")
1616

1717
occurance_remover(r"C:\Users\s158658\src\python-programming\lab-12\test.txt", "foo")

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/unrealapex/python-programming/commit/b4d114fbae7d4f01ca86674dfafdeb5621c356e5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy