Python Classroom notes 17/Apr/2026

Add more features to todo list

  • We dont support completed, we just remove the items
  • We dont track times

  • To do this we need to store

    • id
    • task
    • planned start time
    • planned end time
    • Expected start time
    • Expected end time
    • category
    • completed

Version 1: Using JSON

  • JSON (JavaScript Object Notation) is a file format which uses key value or name value pairs
  • JSON has following types
    • String: "Hello"
    • Number: 10
    • Boolean: true
    • List: [1,2,3]
    • Object: {"key": "value"}
  • JSON "KEY" : VALUE

  • Python has a standard library json

  • Generally json files end with .json extension

  • Refer Here for reading and writing into json files

  • Refer Here for changes

  • Exercise: Our cli doesn’t support complete task

    • Extend todo list to support complete
    • If no action is provide cli should print usage
    • Test the remove task

By continuous learner

enthusiastic technology learner

Leave a Reply

Discover more from Direct AI Powered By Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading