r/learnpython • • Feb 09 '26

My coworker with 6 months experience writes better code than me with 2 years. found out why

2.5k Upvotes

We hired a junior dev and his code is just cleaner, more organized and actually works the first time.

Meanwhile i've been coding for 2 years and my stuff is held together with duct tape and prayers

Finally asked him how he learned and he said he only built projects from day 1. Never did courses. Just picked stuff he wanted to make and figured it out

I spent 18 months doing exercises and tutorials before I built anything real.

Feel like I learned programming completely backwards and now I'm behind someone who started way after me.

Did I screw up my learning path or does everyone go through this?


r/learnpython • • Jul 07 '26

Starting learning Python at 50.

692 Upvotes

50 yo.

No coding experience.

Wish me luck! šŸ¤ž

upd: BIG THANK YOU for the support and warm wishes! Truly, words cannot express how much this inspires me!


r/learnpython • • Mar 05 '26

I spent months learning Python and only today realized I've been confused about something embarrassingly basic

520 Upvotes

I've been writing Python scripts for a while now. Nothing crazy, just automating small stuff, scraping some data, making my life a little easier. I thought I had a decent handle on things.

I was looking at someone else's code and they used a list comprehension in a way that made me stop and read it three times. I realized I had been writing loops the long way this whole time not because I didn't know list comprehensions existed but because I never really trusted myself to read them when I wrote them fast. I kept defaulting to the for loop because at least I could trace it line by line without second-guessing myself.

I don't know if this is a common thing but I feel like there's a version of learning where you know a concept exists, you've seen it work, you've even used it a few times, but you haven't actually internalized it. You're kind of faking fluency in that little area. I was doing that with list comprehensions, with zip, with a few other things I won't list here because it's already embarrassing enough.

Once I wrote out ten examples by hand tonight it clicked in a way it hadn't before even though I'd "learned" this two years ago.

Anyone else have a concept they thought they understood for a long time before actually understanding it?


r/learnpython • • Mar 02 '26

Does it still make sense to learn python or any programming language in 2026

362 Upvotes

I’m sitting here looking at my mentees and for the first time in my career, I’m genuinely questioning the path I’m putting them on.

I’ve been a seasoned pythonista for years, currently at FAANG, so I’ve seen the industry go through plenty of cycles, but 2026 feels like a total break from reality.

We used to treat programming like a craft you had to sweat over, but now that the tools are doing the heavy lifting, I’m wondering if we’re just teaching people to maintain a dying language.

I want to hear from the people actually trying to break in right now. What does the market look like from your perspective? Are you finding that deep Python knowledge actually gets you a seat at the table, or are companies just looking for someone who can glue AI modules together?

I’m asking because my perspective is skewed by being on the inside for so long. I want the raw version of what it’s like to be a junior today.

Is the struggle to learn syntax and architecture still worth it when the barrier to entry seems to be vanishing and the ceiling is lowering at the same time? Tell me if I’m being a cynic or if you’re actually seeing a future where being a coder is still a distinct, valuable skill set.

If you just landed your first job or you’re currently hunting, how much of your actual day is spent thinking about logic versus just managing the output of a machine? I'm trying to figure out if I'm preparing these guys for a career or just a temporary gig before the role of "programmer" disappears entirely.


r/learnpython • • Feb 23 '26 Bravo

What is the use of tuple over lists?

322 Upvotes

Almost every program I try to do uses lists and tuples almost seem not useful. Almost anything a tuple can do can be done via a list and a list is a more flexible option with more functions and mutability hence what is the use of tuples over lists as tuples are completely replaceable by lists (atleast for what I do that is learning python basics) so are there any advantage of tuples?

Thanks in advance


r/learnpython • • Mar 31 '26

Why does Python feel easy to learn but hard to master?

248 Upvotes

Hi everyone,

I recently started learning Python, and one thing I’ve noticed is that it feels really easy at first.

The syntax is simple, concepts like loops and functions are easy to understand, and you can write basic programs quickly. But after a point, things start getting confusing.

When I try to build something on my own or solve slightly complex problems, I get stuck. It feels like I ā€œknowā€ Python, but I don’t feel confident using it properly.

I’m not sure if this is a normal phase or if I’m missing something in my learning approach.

So I wanted to ask:

Did you also feel this while learning Python?
At what point did things start to ā€œclickā€ for you?
What helped you move from basics to actually building real projects?

Would love to hear your experiences šŸ™Œ


r/learnpython • • Feb 21 '26

What is the most complex thing you have ever coded?

233 Upvotes

As a learner of Python, I'm curious to know what wonderful and useful things people here have created with Python. I'm talking about solo projects, not team development.

Can be an app, an algorithm, or some automation.


r/learnpython • • Sep 10 '26

How can I write code without constantly looking things up?

230 Upvotes

I rely a lot on documentation, AI, and websites while writing code. It makes me wonder whether I'm actually capable of understanding concepts like functions and algorithmic thinking. Does anyone else feel this way? What should I do to get a more concrete understanding of Python, or programming in general?


r/learnpython • • Apr 08 '26

Learning Python/coding at 33.

226 Upvotes

Hi all. Like the title says, I'm learning the trade from nothing at 33. I bought an Arduino a month or so ago, wanting to get into electronics. Well, lo and behold it involves programming too. Great, I'll learn that too. Except, arduino uses C++. Okay, I'll learn that. Quickly overwhelmed by that, I start with python instead, to get the fundamentals of coding without the overwhelming syntax. Fast forward a month to today: I have written a handful of text game scripts, and am starting to build a library of functions. Every day I figure out a new thing. Python has been awesome at teaching me how to read and write code, and I started at NOTHING.

It's never too late to start. Have an interest? Just do it.


r/learnpython • • Jul 30 '26

How does the 'for' loop work?

223 Upvotes
words = ['sky', 'apple', 'rhythm', 'fly', 'orange']

for word in words:
    for letter in word:
        if letter.lower() in 'aeiou':
            print(f"'{word}' contains the vowel '{letter}'")
            break
    else:
        print(f"'{word}' has no vowels")

I am trying to learn to code, and I am, at the moment, looking at loops. I am a bit confused on how this loop was able to function, though, as there is no variable for letter or word, so how would Python know what it is? In addition, how does the code, like, function? Does it look at each word individually? Again, the second part of the code states:

 if letter.lower() in 'aeiou':
            print(f"'{word}' contains the vowel '{letter}'")
            break

We haven't given a value for letter?

Lastly, how would the code know what to print? in the first phrase:

            print(f"'{word}' contains the vowel '{letter}'")
            break

Is it going to state all the words with the given value 5 times?

Sorry, as I have asked quite a few questions, and thank you in advance.


r/learnpython • • Sep 24 '26

Who teaches Python the best for complete beginners?

192 Upvotes

Hello, I’m currently learning Python from scratch and I’m looking for a good YouTube course/channel to follow.

I’m mainly looking for someone who explains things clearly and doesn’t rush through the basics. I want to actually understand Python rather than just copy code.

Who would you recommend for a complete beginner? If possible, please share the YouTube channel or specific playlist/course you learned from.

Thanks!


r/learnpython • • Apr 24 '26

The Best Way to Learn Python for Complete Beginners (Personal Experience)

189 Upvotes

I am learning from this book: "Automate The Boring Stuff With Python," and it's actually a very good book that turns specific complex subjects into easy ones that anybody can understand. I'm not aiming to stop at this book only but for now it's better to study this book than to only read it and jump into another one. It will take some time from me, maybe more weeks to finish this book, because I'm reading, taking notes then turning these notes into flashcards (to memorize), then I create projects (try and error) and answer practice questions (that you can find at the end of each chapter). Sometimes it takes days to complete one chapter and jump into the next one, but I feel like I am progressing and understanding Python better.


r/learnpython • • Mar 06 '26

I am 14 and I finally understood why this prints None in Python

189 Upvotes

I used to be confused about why this prints None:

numbers = [1, 2, 3]
print(numbers.append(4))

At first I thought append() would return the updated list.

But append() actually modifies the list in place and returns None.

So Python is effectively doing this:

print(None)

The correct way is:

numbers.append(4)
print(numbers)

Just sharing in case other beginners were confused like I was.

Is there another way you like to explain this concept to beginners?


r/learnpython • • 10d ago

I finished a Python course, but I still need AI to build anything. How do I get past this?

185 Upvotes

So, I am coming here after watching YT videos and reading numerous other posts. I am not going to give you the usual ā€œhow do I learn Python?ā€ question with no context, because if I’d figured it out, I’d be doing my shit instead of asking here.

To the people who do this professionally or are good at it: how would you approach learning Python in 2026, when one AI prompt can give you almost anything within seconds?

I took a Python course, completed it, and then forgot most of what I’d learned because I had no use for it at the time. Now I actually need it for my own work in physics, and I feel like I am back at square one. I see, LinkedIn is full of posts like, ā€œI am happy to announce that I’ve built this package,ā€ etc., etc. And sure, you used your knowledge + AI to build it. But my concern is that if someone asked me to make a package, I wouldn’t even know where to start until I wrote a prompt and read the generated code line by line. I mean, wtf happened? I finished a course, but I still can’t sit down and build something myself.

I feel like I am way, way behind. Someone with 10+ years of experience obviously has knowledge I am not going to catch up with anytime soon. I don’t need to reach their level, but I do want to get to a point where I can confidently write code, understand what I am doing, and figure things out without needing AI to walk me through every step.

The main issue is time. I can go back to books, take another course, and practice problems, but I am worried I’ll end up in the same place: understanding things while I am following along, then going blank when I have to do something on my own. And now, whenever I get stuck, there’s a prompt box right there. I can get working code quickly, but I can’t tell how much I am actually learning versus just getting the task done.

For those of you who’ve been in this position, do you have any suggestions? I feel like I am going around in circles.
Is there a practical way to learn Python with limited time while actually retaining enough to build things myself? (I know ā€œbuild projectsā€ is the best bet but still I wanna hear your thoughts)


r/learnpython • • Sep 18 '26

What does a ā€œnormalā€ professional Python stack look like in 2026?

183 Upvotes

Hi! I’m trying to speedrun learning Python and its ecosystem.

I’m already a senior Node.js / TypeScript engineer, so I’m less interested in programming fundamentals and more in the things you usually only learn after working with Python professionally for a while.

I’m using AI plus courses/tutorials, but I’d love some community perspective on what people actually use in real teams.

Some areas I’m trying to understand:

  • uv vs pip / pip-tools / Poetry for project and dependency management

  • FastAPI vs Flask vs Django

  • Pyright vs mypy for static type checking

  • Pydantic for runtime validation/parsing

  • Ruff / Black / Flake8 / isort

  • pytest vs unittest

  • anything else I should definitely know?

A few specific questions:

  1. Do Python devs actually use type hints heavily nowadays? How common is fully typed Python in professional codebases? Do teams usually run mypy/Pyright in CI, or is typing more informal/partial?

  2. What toolset am I most likely to encounter in an established company? For example, I like uv, but should I expect most existing codebases to still use pip + requirements.txt, Poetry, etc.?

  3. What would you consider ā€œmust knowā€ ecosystem knowledge for someone joining a Python team? Not necessarily your favorite modern stack, but the things I should recognize immediately when opening an unfamiliar repo.

  4. Framework-wise, what’s worth learning first? FastAPI seems very natural coming from Node, but I assume Django is still much more common in mature product companies. How much Flask should I care about?

  5. Any ā€œPython-specificā€ practices that surprise experienced JS/TS engineers? Things like virtual environments, import/package layout, sync vs async conventions, typing culture, packaging, etc.

  6. What about design patterns? Is OOP (Object oriented programming) or FP (Functional Programming) more common? Does it depend on the type of application?

I’m basically trying to optimize for:

ā€œI can join a Python team and not look completely lost in the ecosystem.ā€

Would love to hear what your team actually uses, especially in production.


r/learnpython • • Mar 14 '26

The way pandas handles missing values is diabolical

175 Upvotes

See if you can predict the exact output of this code block:

import pandas as pd
    
values = [0, 1, None, 4]
df = pd.DataFrame({'value': values}) 

for index, row in df.iterrows():
    value = row['value']
    if value:
        print(value, end=', ')

Explanation:

  • The list of values contains int and None types.

  • Pandas upcasts the column to float64 because int64 cannot hold None.

  • None values are converted to np.nan when stored in the dataframe column.

  • During the iteration with iterrows(), pandas converts the float64 scalars. The np.nan becomes float('nan')

  • Python truthiness rules:

    • 0.0 is falsy, so is not printed

    • 1.0 is truthy so is printed.

    • float('nan') is truthy so it is printed. Probably not what you wanted or expected.

    • 4.0 is truthy and is printed.

So, the final output is:

1.0, nan, 4.0,

A safer approach here is: if value and pd.notna(value):

I've faced a lot of bugs due to this behavior, particularly after upgrading my version of pandas. I hope this helps someone to be aware of the trap, and avoid the same woes.

Since every post must be a question, my question is, is there a better way to handle missing data?


r/learnpython • • Aug 21 '26

What Python concept took you the longest to understand properly?

169 Upvotes

For those who learned Python from scratch, which topic was the hardest at first, and what finally helped it click for you?


r/learnpython • • Dec 29 '25

I learned interactive python and it is so amazing

158 Upvotes

so any beginners like super beginners use this. it is so fun i was just so burned out (i am a beginner ).i just learned upto dictionaries and tuples . then i learned about pip , venv etc and i again find learning python so fun.thanks for everyone who suggested me this.

EDIT: By interactive python I mean learning python in a more hands-on way instead of just writing .py files and running them once.

What I used:

VS Code + Python extension
https://marketplace.visualstudio.com/items?itemName=ms-python.python

Jupyter support in VS Code (this helped A LOT)
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter

Virtual environments (venv)
https://docs.python.org/3/library/venv.html

pip (package manager)
https://pip.pypa.io/en/stable/

Using Jupyter / interactive cells lets you run code line by line, see output instantly, test things quickly, and not get burned out.
After learning basics like lists, dicts, tuples, this made python feel fun again for me.

I’m still a beginner, but this really helped

EDIT: many of you guys are asking me about which video so https://youtu.be/ygXn5nV5qFc?si=-qDjy4_-YIpORX0g i was just watching this video and at the start while setting my vscoe i got to know these things


r/learnpython • • Aug 10 '26

Starting Python from Scratch

157 Upvotes

I want to start learning Python from scratch. What’s the best way to begin, and which resources would you recommend?
Would appreciate any good courses, YouTube channels, books, or practice platforms that worked for you.


r/learnpython • • Jun 11 '26

I Understand Python While Learning, But Forget Most of It After a Week. How Did You Make It Stick?

156 Upvotes

I am trying to learn Python, but I keep forgetting what I learn after a few days. Looking for advice from experienced developers.

I have around 4.6 years of experience in the telecom domain, mainly in Revenue Assurance, Fraud Management, integration, SQL, Linux, and low-code/no-code tools.

Recently, I started learning Python because I want to move towards Data Engineering and modern data platforms. While studying, I understand the concepts, syntax, and examples. However, after 3-7 days, I find that I have forgotten a lot of what I learned and struggle to write code from memory.

For example, I may understand:

Loops

Functions

Lists and Dictionaries

String Manipulation

But if I don't practice for a few days, I cannot confidently write code without referring to notes or documentation.

My questions are:

Is this normal when learning Python?

What is the most effective way to retain what I learn?

Should I focus more on theory, coding exercises, projects, or repetition?

How did you learn Python and make it stick long-term?

For someone targeting Data Engineering, what Python topics should I prioritize?

I would appreciate advice from people who have successfully learned Python and use it professionally.


r/learnpython • • Mar 24 '26

What do people mean when they say "don't use too many if statements" and how do you avoid it?

154 Upvotes

I'm not working/learning python atm but recently took a basic intro course on it and one of the things I heard a lot from others was some variation of "don't spam if statements". So if not then how would you write conditionals or is there something I missed?
An example of spamming if statements would be like the old code for yandere sim


r/learnpython • • Feb 13 '26

Started learning Python but AI makes me feel late to the party – advice?

148 Upvotes

I don’t know if I need to ask a specific question or if I’m just looking for some encouragement here.

I’ve wanted to learn Python for years, and it finally feels like the stars have aligned. I have the time, the energy, and the luxury to sit down and really learn something I’ve always loved the idea of: programming. I started with automate the boring stuff (from Al Sweigart) but got bored and I’ve been using this online practice platform (https://activeskill.dev) that gives me exercises and It tracks my streak, lets me compare progress with a few friends, and that has been working pretty well.

But I feel really bothered by the whole AI boom.

I finally decided to commit to learning Python, right at the moment when it feels like AI can write code faster and better than I ever could. Part of me keeps thinking: Is there even a point in learning this now? Will I ever be ā€œgood enoughā€ compared to these tools? Am I already too late?

So I guess my question for this community is: How do you stay motivated to learn Python in the age of AI?

I’m hoping to hear from people who are ahead of me on this path—whether you’re still learning or already working with Python—about why it’s still worth it, and how you balance using AI tools without letting them steal your joy or confidence.

Thanks for reading this far. Even a few words of encouragement or your own experience would mean a lot.

Edit: Thanks for the encouragements! This was like a mental recharge. Definitely motivated to start learning again!


r/learnpython • • 12d ago

How much Python do you actually need for a data analyst job?

145 Upvotes

I work in data in the UK, and this is one of the most common questions I hear from people learning Python. Short answer: less than you’d think, but the right parts matter.

What you’ll actually use day to day

  • pandas for cleaning and reshaping data: filtering, merging, grouping, handling missing values and dates

  • Reading and writing files (CSV, Excel, JSON) and connecting to a database

  • Basic charts with matplotlib or seaborn

  • Functions and loops, enough to write a clean, reusable script

What you can usually skip at first

  • Advanced OOP, decorators, async

  • Web frameworks

  • Heavy algorithm and data-structure puzzles (unless you’re aiming for software roles)

What matters more than syntax

  • SQL. Most analyst roles use it more than Python.

  • Being able to explain what your code is doing and why the output makes sense.

  • Spotting when the data looks wrong, which no library does for you.

If you can take a messy CSV, clean it, answer a real question, and explain the result clearly, that’s already at a junior analyst level. One or two projects like that matter more than finishing ten courses.

For people already working in data: what would you add or take out? And beginners, what part of Python are you finding hardest?


r/learnpython • • Sep 02 '26

I'm 37 and looking for a complete career change.

140 Upvotes

I've worked as a baker for most of my adult life, during Covid I left my job and transitioned to baking from home. Things were going well, but for the past few months, my mum's health has been declining and as her primary caregiver, I can't carry on with that job and I'm looking for something that I can work from home on my computer.

After looking at various options, I found Python and how it's useful in many places. My tech skills are absolutely basic, I mean I can navigate stuff and if I don't know anything I can look up how to go about it but coding and creating stuff is beyond me. I learnt the basics about computers back in school but that was over a decade ago, so I understand that it's a new language and understand the concept of scripts.

I want to know if investing myself in learning Python is worth it? I understand that it's not a quick thing, that I need to dedicate time to it and practice to keep up and grow my skills. I'd also like to know what kind of careers I can look into so that I can work from home.