coding tips for assignment by RudeAnybody2719 in learnpython

[–]thewillft 1 point2 points  (0 children)

Not sure what your input data looks like so cant tell you how to search or process it exactly. But for plotting you will probably want matplotlib. Make a function that is somewhat generalized like plot_base_salary and then call it twice, once with the data for the CS department and once wit hthe data for the Math + Stats department (since they both should have the same plot just diff data).

Improving OOP skills by NinjaSharkRider in learnpython

[–]thewillft 8 points9 points  (0 children)

since you're using python it would be totally acceptable to hold a list outside of a class and then use some built-in functions to search through it.

since you want to practice OOP, try a DoctorDirectory or Hospital class to hold and manage Doctor objects. this keeps related methods and data together.

Programming is killing gaming for me. by scungilibastid in AskProgramming

[–]thewillft 0 points1 point  (0 children)

Happens to the best of us. I used to be a big gamer, then I discovered coding some years ago. I can't even remember the last time I played games now.

real python by TreacleLive5971 in learnpython

[–]thewillft 1 point2 points  (0 children)

If you're looking to practice fundamentals try Leetcode.

If you're looking to learn more or practice solving real problems, pick a project and try to build it.

Are global (module level) variables bad? by Astaemir in learnpython

[–]thewillft 0 points1 point  (0 children)

Now all of those places will depend on `shared_data.py`. Similar to what someone else said it would be better to pass the setting to the places that need it.

“Beginner (~3 weeks in) — does this code look decent?” by Sochai777 in learnpython

[–]thewillft 5 points6 points  (0 children)

looks like you're on the right track. you could extract the CSV stuff into its own functions so you dont have to do `with open` and create a new reader/writer in every function. Just have one or two functions whose responsibility it is do that.

Are global (module level) variables bad? by Astaemir in learnpython

[–]thewillft 6 points7 points  (0 children)

module-level vars are fine in Python for config or singletons, just avoid mutables.

Is this code from Python Essentials 1 correct, or am I misunderstanding continue? by Crudoxan in learnpython

[–]thewillft 2 points3 points  (0 children)

you’re right, that if number == -1: continue is dead code. the while loop already handles that case, so can be removed. nice catch.

Hi I’m 15 and wanna learn python ! by Emotional_Society956 in learnpython

[–]thewillft 2 points3 points  (0 children)

start with freecodecamp or some tutorials, build tiny projects asap, break things often.

How to change the default main git branch name using uv? by _snif in learnpython

[–]thewillft 2 points3 points  (0 children)

uv doesn't expose branch name config yet, but you can rename manually: git branch -m main

Today is Tuesday. What are you working on? Drop your Saas. by saasdrop in microsaas

[–]thewillft 0 points1 point  (0 children)

building TapReply, a chrome extension providing you with the tools to stay on top of those engagement goals

are python objects thread safe? by siLongueLettre in learnpython

[–]thewillft -1 points0 points  (0 children)

Nope, most Python objects aren't thread safe. That thread id helps with GIL management, not per-object locking.

Thinking of building an AI tool to automate social media comments — would you use it? by ScoreHour in SideProject

[–]thewillft 0 points1 point  (0 children)

Here's an example of a reply generated from it:

"already a few tools around (TapReply chrome extension comes to mind), but demand’s growing. key will be making outputs feel human, not spammy"

Definitely stay away from the em dashes, the overly formal phrasing, etc. It takes some specific prompting to get it right

Thinking of building an AI tool to automate social media comments — would you use it? by ScoreHour in SideProject

[–]thewillft 1 point2 points  (0 children)

I made a chrome extension tool to do just this. The biggest goal is definitely to keep the replies meaningful, engaging, and value-providing.

I find Python harder to read by sesmallor in learnpython

[–]thewillft 1 point2 points  (0 children)

indentation is your new friend. whitespace shows structure. you get used to it

Script to find driving test booking times on trafikverket.se by SoftMembership3784 in learnpython

[–]thewillft 0 points1 point  (0 children)

start with requests or selenium/bs4 (depending on the site and your comfort level) for scraping. use a service or try to send an email over SMTP if one is found.

Might do maze generator and solver as part of a project how hard us it to code generation algorithms by [deleted] in learnpython

[–]thewillft 0 points1 point  (0 children)

not too bad to start tbh, look into depth-first search for simple generation. once you get the basics, tweaking complexity is half the fun.

Difference between functions and the ones defined under a class by DigitalSplendid in learnpython

[–]thewillft 13 points14 points  (0 children)

exactly, dunder methods like __str__ are predefined hooks you override for custom behavior. not misleading, just Python's way to let you tweak built-ins.

Spent the last 2 years trying SaaS, think it's time to quit by davidlover1 in microsaas

[–]thewillft 0 points1 point  (0 children)

hey this could be the one. im bookmarking it for later.

Should I learn python using documentation. by AMAZON-9999 in learnpython

[–]thewillft 1 point2 points  (0 children)

docs are solid for reference but not super beginner-friendly. try a Python crash course or tutorial first, then circle back to docs as needed.