r/PythonLearning • • Sep 06 '25

day 4 of learning python

Post image

I just started my first small project, implementing what I’ve learned so far. I recently began learning about the def statement, so I'm not sure if I'm using it correctly. Any tips would be appreciated, im coding for about 2/3 hours a day using the book 'automate the boring stuff with python' second edition . this my first ever reddit post so it feels weird sharing my progress and if im on the right track.

113 Upvotes

19 comments sorted by

View all comments

2

u/kjrusse Sep 06 '25

I'm not a very experienced Python coder, but I'm confused as the code references self.accountBalance and self.balance in the class functions. I see that current amounts are added to self.balance and debts are removed from self.balance, but the account was initialized with self.accountBalance and the balance query also references self.accountBalance so I'm not sure where self.balance comes from??? Absolutely no offense meant at all, just trying to understand.

2

u/JaleyHoelOsment Sep 07 '25

good catch. those methods would fail. OP just hasn’t called them here so hasn’t fixed that issue yet.

2

u/Ok-Paper540 Sep 07 '25

thank you for letting me know in advance ill fix them when i get the chance =)

1

u/JaleyHoelOsment Sep 07 '25

also OP, in your code, no matter what name i enter it will always call me Billy!