diff --git a/.DS_Store b/.DS_Store index a688765..5a44c1e 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Lab 1/.DS_Store b/Lab 1/.DS_Store index ae45dbe..dc8904e 100644 Binary files a/Lab 1/.DS_Store and b/Lab 1/.DS_Store differ diff --git a/Lab 1/Screenshot 3.png b/Lab 1/Screenshot 3.png new file mode 100644 index 0000000..4c04ec1 Binary files /dev/null and b/Lab 1/Screenshot 3.png differ diff --git a/Lab 1/Screenshot 4.png b/Lab 1/Screenshot 4.png new file mode 100644 index 0000000..04b2234 Binary files /dev/null and b/Lab 1/Screenshot 4.png differ diff --git a/Lab 1/Screenshot 5.png b/Lab 1/Screenshot 5.png new file mode 100644 index 0000000..902b387 Binary files /dev/null and b/Lab 1/Screenshot 5.png differ diff --git a/Lab 1/Screenshot 6.png b/Lab 1/Screenshot 6.png new file mode 100644 index 0000000..f393ab6 Binary files /dev/null and b/Lab 1/Screenshot 6.png differ diff --git a/Lab 1/count_words.py b/Lab 1/count_words.py index c422588..2069b03 100644 --- a/Lab 1/count_words.py +++ b/Lab 1/count_words.py @@ -19,10 +19,17 @@ def countWords(filename: str) -> dict[str, int]: def main() -> None: - filename = "words.txt" + filename = "data/words.txt" counts = countWords(filename) print(counts) if __name__ == "__main__": main() + +""" +1. Copying a file created 2 identical coppies so the funciton can still read the data. +2. cp is safer because it leave the original file untouched. +3. If the data folder is deleted, the program will not be able to find the file and will raise a FileNotFoundError. +4. The dictionary keys represent words, which are strings. If they were stored as integers, boolens, floats, etc, it would create errors. +""" \ No newline at end of file diff --git a/Lab 1/words.txt b/Lab 1/data/words.txt similarity index 100% rename from Lab 1/words.txt rename to Lab 1/data/words.txt