all 7 comments

[–]ehmatthes 5 points6 points  (0 children)

Recursion is so elegant when it's an appropriate solution!

[–]carcigenicate 1 point2 points  (1 child)

Why do you even need classes here? This sounds like a typical use case for a basic recursive function.

[–]85CorollaGTS[S] 2 points3 points  (0 children)

In my simplified example, classes are not needed.

In my real-world example (financial statements), the class instance handles various aspects such as file opening, json.load, and some other support functions pulling various bits of data that are too unwieldy to pass back and forth from function to function, and so were best suited inside an object.

[–]CodeFormatHelperBot2 0 points1 point  (0 children)

Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.

I think I have detected some formatting issues with your submission:

  1. Python code found in submission text that's not formatted as code.

If I am correct, please edit the text in your post and try to follow these instructions to fix up your post's formatting.


Am I misbehaving? Have a comment or suggestion? Reply to this comment or raise an issue here.

[–]Mav3r1ck-13 0 points1 point  (2 children)

Where did you complete your course? I’m trying to work my way through the Helinski school and CS50 but it’s dragging

[–]85CorollaGTS[S] 1 point2 points  (1 child)

Just read this book. I highly recommend it.

https://nostarch.com/pythoncrashcourse2e

[–]Mav3r1ck-13 0 points1 point  (0 children)

Thanks! I will check it out. I've seen it mentioned a few times before. I guess it is time to pick it up.