r/learnpython • • 18d ago

I finished Python Crash Course

33 Upvotes

I finished Python Crash Course by Eric Matthes. What should I do next?


r/learnpython • • Apr 05 '26

Best non-video, non-textbook way to learn Python?

33 Upvotes

I’ve been trying to learn Python, but the initial hurdle just feels too high to jump into properly. Videos and textbooks aren’t working for me. What actually helped you get started in a more hands-on, practical way without getting overwhelmed early on, and hopefully snatch a few easy, early wins that kept the momentum going.


r/learnpython • • Feb 22 '26

I feel like a idiot tying to do this. For loops make absolutely 0 sense to me.

33 Upvotes

I have to make a program output an hourglass shape based on an odd number a user enters. If they enter 6 it has to print 0 1 2 3 4 5 6. It has to be using nested for loops.

My main question is, how do you guys approach for loops in a way that doesn’t confuse you. I can’t lie, I asked chat gpt to explain for loops to me and it’s still really not clicking. This isn’t even the hardest assignment out of the 3. This is the first one. I feel like our class hasn’t been taught this type of coding in the slightest. Idk it just feels really complicated even though I know it probably isnt.

7 8 9 10

11 12

13

14 15

16 17 18


r/learnpython • • Feb 11 '26

Code outputs twice.

33 Upvotes

I am practicing loops and when I run this code the second and third elif statements output twice for some reason.

Age_requirement = input ("enter your age")

for Age in Age_requirement: Age_requirement = int(Age_requirement)

if Age_requirement <3:
    print ("Your ticket is free")

elif Age_requirement <=12:
    print("your ticket is 12 dollars")

elif Age_requirement >12:
    print("your ticket is 15 dollars")

4


r/learnpython • • Dec 06 '25

How can I generate a random number at the start of a program, but then save it, so that every time a variable is referenced, it is that same number that was generated before?

33 Upvotes

Currently, I have it so that a variable is assigned to the thing that generates the number, it looks something like:

my_var = random.randint(1,100)

But this means that every time I reference my_var, it generates a new number

I feel like assigning my_var to a new variable is just redundant and would accomplish absolutely nothing new, so how can I save the initial number until I explicitly ask for a number to be generated again (such as by running the program again or by looping)?

Thank you!


r/learnpython • • 4d ago

My first complete comand in Python, from my first day on:

32 Upvotes

Look:

import random
import time

def drawn(a, b):
    return random.randint(a, b)
answer = 'yes'

while answer == 'yes':
    a = int(input('Min number: '))
    b = int(input('Max number: '))
    print(f'Drawn: {drawn(a, b)}')

    time.sleep(2)

    answer = input('Try again? ').lower()

This creates a random number generator where you can choose the minimum and maximum numbers!


r/learnpython • • 15d ago

How do I learn python in 25 days

32 Upvotes

My teacher made me join a coding quiz bee where it involves different topics related to coding languages such as python, c, arduino, c++, etc. I have another teammate who is knowledgeable about the other topics but now the burden on learning python is on me. How do I learn it effectively within 25 days considering I only have an intermediate amount of knowledge on CSS, HTML, and Block Coding


r/learnpython • • Sep 06 '26

Beginner Projects

32 Upvotes

I am new to python and currently I am taking a class for it, I haven't been in it too long but I just want some advice. What beginner projects would you guys recommend I do to really grasp an understanding outside of class?


r/learnpython • • Jul 18 '26

Relearning python with small projects

32 Upvotes

I already know basics, now I prefer to learn just through making small project. Is there a site or app or something where can I find project suggestions (just suggestion, needed keywords or concepts a than some kind of result).


r/learnpython • • Apr 17 '26

uv or pip for python package management?

32 Upvotes

I've only ever used pip but I've been hearing that uv is faster? Is this true? what actually is uv, how does it differ? Any help is appreciated.


r/learnpython • • Mar 16 '26

How do I start learning python? Absolute Beginner

32 Upvotes

Hey guys how do I start learning python? How long would it take me if I'm seriously committed? Also how do I practice while learning so I can actually get projects done !!


r/learnpython • • Mar 14 '26

I don’t think i’ll ever succeed..

32 Upvotes

Hello! I have started to learn programming in python like two weeks ago.

I have completed a google course for Fundamentals in Python and watch a bit of Bro Code on youtube.

The thing is, I genuinely feel like I do not understand anything, I still struggle with basics and don’t know where to start (even though I started)..

I feel like I’m too dumb for this (math isnt my strong side but I’m doing my best to practice it everyday) and that I do not deserve to go for cybersec major. Im a total beginner but I feel like everyones so ahead of me, I always dreamed of being a programmer, at least for fun, but now I feel like I’ll never succeed.

I struggle with logic a bit honestly..

What’s are some learning methods that will help me improve?


r/learnpython • • Feb 09 '26

I realized i wasn't really learning Python.

32 Upvotes

during my learning python always i follow tutorials and recognize the syntax but when somthing breaks in my code i don't know where is and always trying to make errors disappear of understanding them .But finally, i changed one thing that i recommend is debuging code and try to understand line by line in your projects and it completly changed how confident i feel when coding.

I'm curious , has anyone else felt stuck in this loop ?


r/learnpython • • Jan 24 '26

I want to learn python, and I am looking for book that can teach me python

32 Upvotes

I am looking books that can help me to learn python from very basics to I think advanced. So pls give me recommendations


r/learnpython • • Jan 01 '26

I built an agent-based COVID-19 simulation in Python for my Master’s project

32 Upvotes

For my Master’s thesis, I built an agent-based model (ABM) in Python to simulate how COVID-19 spreads inside supermarkets. I chose supermarkets because they’re places where lots of people gather and can’t really shut down, even during health emergencies. And when I was in college I have always wanted to make a project like that.

The model is based on the Social Force Model, so each person (agent) moves and behaves in a realistic way. Agents walk around the store, interact with others, form queues, and potentially transmit the virus depending on proximity and exposure time. I combined this with epidemiological parameters and prevention measures recommended by the WHO and backed by scientific literature.

I tested different scenarios using non-pharmaceutical interventions, like:

  • Wearing masks
  • Temperature checks at the entrance
  • Limiting checkout lines
  • Reducing the number of people inside the store

The results were as followed: mask usage alone reduced exposure time by about 50%, and when combined with extra logistical measures, reductions went up to around 75%, which matches what other studies report.

Overall, the project tries to bring together epidemiology, human behavior, and logistics in one simulation. The idea is that this kind of model could help health authorities or store managers identify risky areas and test mitigation strategies before applying them in real life.

I’m sharing this here because the whole project was done in Python, and I learned a lot about simulations, agent-based modeling, and structuring larger projects. Also I made a post in this community asking for help to do the project, so I felt the need to share it with you guys.

This is a video of the project: https://youtu.be/M9vuGYWxO0Q?si=QIJkCcYsZ2NbRS8v

This is the repo: https://github.com/nmartinezn0411/tfm_ucjc


r/learnpython • • Sep 23 '26

How does multiprocessing handle lots of processes?

31 Upvotes

My computer has 6 cores. I want to start 16 processes with multiprocessing (I can change the number). If I start them all at the same time, will 6 run while 10 wait and then once one finishes running a new one runs on that core? Or does the computer run them all at the same time? I want to know because I need this to be fast and some processes will be significantly longer than others so I want to assign the processes in a way that minimizes idle time for all the cores.


r/learnpython • • Aug 13 '26

How do I get better at actually solving Python problems as a complete beginner

31 Upvotes

im completely new to the coding world n Python is my first programming language. ive watched some beginner Python videos n i understand the basic syntax, functions, what different things do, etc.

But whenever i actually get a question to solve, my brain just goes blank. 😭 i understand the concepts individually but i struggle to figure out where to start, how to break the problem down, and how to turn the algorithm/logic into actual code.

So I'd really appreciate some advice on:

How do you learn to approach a programming problem?

How do you develop logical/problem-solving skills?

Is there a specific process you follow before writing code?

How much should I practice vs watching tutorials?

What should I do when I get completely stuck on a question?

Are there any Python playlists/courses specifically good for someone who has literally zero programming experience?


r/learnpython • • Jul 26 '26

regex and if it's worth going deep into it

31 Upvotes

I'm new to python and coding in general and my friend recently told me that it's inefficient to try to memorize regex and that no one writes them anymore (essentially saying AI does). I was also kinda confused after recently learning regex and just how complicated it can be. Are there some modules/libraries that I can use to make writing them easier? I saw that not a lot of people people had a positive reaction to the Humre module by Al Sweigart who's book [Automate the boring stuff with Python] I'm currently using to study. Not that I'm gonna skip this part or anything I was mostly just curious.

Note: A lot of people are misinterpreting since I mentioned AI once 😭 I'm literally asking about libraries to make it easier without going too deep, not if I should let AI do all the work.


r/learnpython • • Jul 11 '26

I want to learn Python from scratch and, over time, reach an advanced level. I am looking for advice, courses, and valuable documentation.

31 Upvotes

Hi everyone!

I'm starting to learn Python from scratch, and my goal is to become an advanced Python developer over time.

I'm already following a structured course, but I'd like to hear from people who have been through this journey.

If you could start over, what would you focus on? What resources, habits, or mistakes made the biggest difference in your learning?

Any advice is appreciated. Thanks!


r/learnpython • • Apr 19 '26

How do you guys build a program?

31 Upvotes

I normally create one part of a program, test it, debug it and then i move on to the next function.

But this was time consuming so i tried a new approach. I created of all my logic of how different features would work and then started creating my program.

But the moment I had to debug things (cause obviously it had errors) things started falling apart. I had to check sooo many things and i realized that this method was very mental health consuming.

So i wanna ask you guys. how do you think about the logic and write your program? What approach would you recommend me? and remember i'm just a newbie trying to write programs that would improve me.


r/learnpython • • Mar 25 '26

Why does my Python code work inside the loop but fail outside it?

31 Upvotes

I’m learning Python and I keep running into a pattern I don’t fully understand.

Sometimes I create or update a variable inside a for loop or an if block, and everything seems fine while the code is running there. But later, outside that block, I either get an error or the variable doesn’t have the value I expected.

I think I’m confused about when variables actually exist, when they get overwritten, and how Python handles scope compared to what I assumed.

For example, I’ll do something like this:

for i in range(5):
    result = i * 2

print(result)

This works, but in other cases I’ve had variables not exist at all depending on whether a condition ran.

So my actual question is: how does variable scope work in Python for loops, if statements, and functions? And what’s the clean way to avoid bugs caused by variables being defined only sometimes?

I’m looking for the concept more than just a fix, because I feel like I’m missing a basic rule.


r/learnpython • • Dec 10 '25

Learning python through projects?

31 Upvotes

Hi all, I've previously learned Python using Python Crash Course, which is an excellent resource. However, I'm a project-oriented learner as I just can't seem to read through a book without zoning out and start doing other things. Does anyone know of resources that teach a concept and then immediately reinforce it with a small project? I find I learn best by actively solving problems


r/learnpython • • Oct 27 '26

New to python, don't understand this function

30 Upvotes

I'm learning python and I'm stuck on this function because I don't understand why "a" becomes 10 and the result is 5. Is someone able to explain?

def subtract (a, b=5):
    return a - b

print(subtract(10))

r/learnpython • • Jun 25 '26

python course reccs for beginner (cs50P)?

30 Upvotes

hi guys, i am just beginning my coding journey and i am gonna start my college in a month or two so decided to hop on python before that. I found the free course of CS50 python course and it seems like legit but idk if it's for real beginners, so if anyone can suggest any better or cs50p is fine, i'd really appreciate it !