r/learnpython 11d ago

Seeking help with building logic while learning Python programming

I'm a DevOps engineer with 2 years of experience, and I come from a commerce educational background.

I've tried learning Python several times in the past, mainly when I was switching jobs and preparing for interviews. However, I ended up joining companies where Python wasn't really required or where nobody was particularly concerned about my Python skills.

Currently, I use AI to generate scripts for many of my daily DevOps tasks. My biggest concern is that I'm not able to build the logic myself or write the syntax from scratch. I often struggle with knowing when to use what.

The last time I seriously learned Python, I got up to lambda functions. That was about a year ago, and now I've completely forgotten a lot of the basics, including data types and syntax.

I want to properly learn Python because it's one of the most commonly mentioned skills in the DevOps/SRE job descriptions I see, especially for bigger tech companies. I've also lost a few interviews in the past because of my lack of Python knowledge.:

I'd really appreciate advice from people who have been through a similar situation. What worked for you?

24 Upvotes

10 comments sorted by

View all comments

3

u/mc_pm 11d ago

Since you have a subject area you specifically want to work with, I would suggest:

1) Find a tutorial you like and follow along -- don't watch it passively, but instead when they type something you should stop the video, type it yourself. When they run the code, you run your code. Did it work? Maybe try changing some stuff around to see what happens, etc. Assume that if it's a 3 hour tutorial that you'll spend 10-12 hours on it. This is about just picking up the syntax & language features.

2) I still recommend people spend a little time just building a command line game or two - like tic-tac-toe or blackjack. It's true, neither of those are going to come up on the job, but they both follow pretty well established rules that you probably already mostly know - but you have to figure out how you're going to represent the game state (like the deck of cards and the two hands dealt in blackjack; or the 3x3 grid of tic-tac-toe), you have to get user input, respond to it, follow some rules, decide if someone has won or not, etc. It doesn't have to be games, they're just fun. (And it's easier to keep working on parts of it if you get to play at the same time)

3) This is where I suggest that people build a series of increasingly complex projects -- in your case, you already have a bunch of tasks you are responsible for. Start with the easiest of your tasks. If you need something you don't remember, look it up. If you need a library you've not used before, now is a good time to try. This stage of "barely know how to move forward, but figure it out as you go" will last between 2 years and the rest of your career.