본문 바로가기
Python(Eng. ver)

21. Creating a vocabulary book using file input and output

by 곽정우 2024. 3. 21.

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 a file, words.txt)
  • If 5 is selected:
    • Turn Off
  • If a number other than 1 to 5 is entered: *Retry!

Design the program using classes

 

Answer

 

Result

'Python(Eng. ver)' 카테고리의 다른 글

23. Python File I/O Library  (0) 2024.03.21
22. Variable type annotation  (0) 2024.03.21
20. File I/O in Python  (0) 2024.03.20
19. Python Module  (0) 2024.03.20
18. Python Error Handling  (0) 2024.03.19