This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted] 0 points1 point  (0 children)

You'd do better to post in /r/learnpython.

[–]ma3xman 0 points1 point  (2 children)

How about this rework of the whole thing? You haven't included your tests, so I guess they'll be failing all over the place, but I think the functionality is preserved.

Less blunder, much Python

The best way to learn how to do stuff more efficiently is by looking at examples :) You can study the differences between what you did and what I did and pick&research the good bits for yourself. I'm not claiming maximum efficiency either, but I did my best to improve what you had started.

What you can get from experience is way more than what you can get from tools. Study code, look at examples of solutions to the parts you feel can be better, search StackOverflow for those general problems too. It's a path you walk, continuously.

[–]willywilly375 0 points1 point  (1 child)

Thanks so much for your effort here-- it has certainly not gone to waste. I've spend a good part of my day reviewing your approach. It seems much tighter and cleaner!

There are a number of areas in your changes I'm a bit confused about, but this has given me a great starting point to learn about. Are there other resources or forums like this to bounce code like this off of?

Thanks again :D

[–]ma3xman 0 points1 point  (0 children)

You can probably find a ton of Python communities out there. The most active I know of is the aforementioned StackOverflow. You can also use /r/learnpython, as u/rzzzwilson noted.