본문 바로가기

Python24

24. Directory Management Program 1. Organizing compressed files 2. Organizing file names 3. Change file name 4. Classify and move files ✔ assert Used to check if a given condition is True and raise an exception if the condition is False. Mainly used in code for debugging and testing purposes. Works only in debug mode, does not work during deployment 2024. 3. 22.
23. Python File I/O Library 1. OS The os module in Python provides many functions and utilities for interacting with the operating system. This module allows userto perform operations on files, directories, or the operating system itself. 2. glob The glob module provides functions and utilities for interacting with the operating system. This module allows user to perform operations on files, directories, or the operating s.. 2024. 3. 21.
22. Variable type annotation 1. Variable type annotation Python variable type annotations are a feature that allows user to specify the type of data that a variable will store. This can greatly improve the readability of user code and help user catch type errors early in the development process. Improved readability: By specifying the type of a variable, you make it easier for anyone reading your code to understand what kin.. 2024. 3. 21.
21. Creating a vocabulary book using file input and output Question Create an English vocabulary program that satisfies the following conditions: 1.Register, 2. Print, 3.Save, 4. Load, 5. Off If 1 is selected: Enter the word: apple Enter the meaning: 사과 (apple in Korean) Enter the level: 1 Registered If 2 is selected: apple: 사과 (Level 1) If 3 is selected: Saved successfully. (Saved to a file, words.txt) If 4 is selected: Loaded successfully. (Read from .. 2024. 3. 21.