Python Classroom notes 23/Jul/2026

Financial calculator

  • We will be create two projects

Plain

  • plain calculator: Here we will write the code without following any design principles

  • We had implemented simple and compound intrest Refer Here

  • As we are building financial calcualtor which will have many types of calcuations

  • Each calcuation might reguire different inputs
  • so if we follow the above approach then we would end up writing different functions and many conditional blocks in argparse

Design Based

  • Any caclulator will have to

    • validate arguments
    • compute values
    • present the result
  • Refer Here for the changes where we implemented

    • abstraction
    • Template method pattern (run method)
  • Exercise: Try implementing a factory to get the concrete calculation object.

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