Need Feedback on Budget App Python

Hi, I have just built my 3rd project Budget App and would love to hear feedback on the code I have written :smiley:

The code to my project is given below:

It would be helpful if you have given some feedback on the code

Have a good day :smiley:


Really good approach @Ganesh_27

Your code is optimal

can you explain me what is the purpose of __str__ function ?
how it helps to print the bill

Hi @ShreyasSubhedar tq for your feedback. :grinning:
This function basically returns the string representation . As mentioned in requirements the string representation should a return a string when str() is used.

It first prints the ‘*’ with category name and then all the ledger operations

1 Like

Thanks @Ganesh_27 Now I understand the __str__(self) function

if I add another category or say the fourth one category then your code will not print exact “-” character.

1 Like

I suggest changing line 105 to:

s += "    " + ("-" * ((len(categories) * 3) + 1))+ "\n"