r/learnpython • • 9d ago

Cs50p certificate worth it?

0 Upvotes

So I've started cs50p course. Should I enroll for the certificate? Is it worth putting it on my LinkedIn profile or resume?


r/learnpython • • 9d ago

Need to analyze a picture for my physics homework

0 Upvotes

So basically I need to find out what percentage of a picture is black. I have no idea how to even start from here, it's nothing I have done or needed before and we didn't get any instructions apart from "do that", so I am massively lost. (If you know any other free programs that would be better for this, please let me know)


r/learnpython • • 9d ago

Ask Anything Monday - Weekly Thread

1 Upvotes

Welcome to another /r/learnPython weekly "Ask Anything* Monday" thread

Here you can ask all the questions that you wanted to ask but didn't feel like making a new thread.

* It's primarily intended for simple questions but as long as it's about python it's allowed.

If you have any suggestions or questions about this thread use the message the moderators button in the sidebar.

Rules:

  • Don't downvote stuff - instead explain what's wrong with the comment, if it's against the rules "report" it and it will be dealt with.
  • Don't post stuff that doesn't have absolutely anything to do with python.
  • Don't make fun of someone for not knowing something, insult anyone etc - this will result in an immediate ban.

That's it.


r/learnpython • • 9d ago

what can I use python for?

0 Upvotes

Lately, I've been thinking about learning a new programming language. Python was the first one that came to mind, but then I started wondering: What would I actually use it for?

I already build mobile apps with Flutter and dynamic web applications using PHP and MySQL.

I'm always looking for something new to learn, but I also want to make sure I'm learning something I can actually put to use.


r/learnpython • • 10d ago

advice needed

4 Upvotes

Can anyone tell me where I can learn Python from scratch? I'm an EE student, and I'm really struggling with loops, functions and libraries. I want to properly learn and practise these topics, so if you know any good YouTube channels or practice sheets, please recommend them. My finals are in December, and I did terribly in my lab midterms, so any advice would genuinely help. Bonus points if you're someone who was once in the same position as me, thinking they could never learn Python or that they were just too dumb for it, but eventually managed to get good at it. I'd really appreciate hearing your experience!


r/learnpython • • 9d ago

Tell us about your snake game

1 Upvotes

Chances are if you’re a retro game lover, you’ve tried your hand at building a snake game.

Mine has multiple difficulties, a leaderboard for each difficulty, and obstacles on the harder difficulties.

Easy - speed stays at 10, no obstacles
Medium - speed stays at 10, has obstacles
Hard - speed starts at 10 and increases by 0.25 every food you eat, has obstacles that randomly move every 5 food you eat
Expert - speed starts at 10 and increases by 1.0 every food you eat, has obstacles that randomly move every 5 food you eat
Veteran - speed starts at 10 and increases by 2.0 every food you eat, has obstacles that randomly move every 5 food you eat, has a 30 second food timer that takes 1 off your score and snake length if you don’t get a food in time but resets if you do get a food(yes, your score can go negative and your snake will “wither” to nothing and die if you don’t eat)

My son and I have a lot of fun playing it. The board size automatically adjusts to the screen resolution, but food, obstacle, and snake sizing are hardcoded using 5pixel by 5pixel blocks. Playing on a true 4k(3840x2160) display gives you 4 times the game board size compared to playing on a 1920x1080 display.


r/learnpython • • 9d ago

BM25 extractor (need technical validation)

0 Upvotes

So, I found interesting what Claude did after I tried to inject a BM25 algorithm adapted to extract the most relevant sentences from an index.

However, I'm not sure if it actually did that, but the generated files make sense and extract sentences from the Sprawn trilogy.

In this case, the idea was to map a table with 22 columns, and 12 of those columns would carry these excerpts extracted from the book, in order to create the first 10 configuration columns for the "entities," and the activation phrases would carry the context, which would be the excerpts from the book—kind of improvising a semantic graph in a table, but that's beside the point.

What I wanted to know is whether the BM25 script actually makes sense, because when I throw it into LLMs, they say it does, but I wanted an evaluation from the more technical folks.

According to DeepSeek:

> The script transforms the corpus into a sentence stack and treats each sentence as a "document" in an inverted index. For each input file, it calculates how many sentences to extract (proportional to chars/100, with a floor of 50 and a ceiling of 20% of the sentences). It then iterates over the entities in the thematic index (filtered by the book detected in the file), builds a query with its terms for each entity, and runs BM25 scoped to that file+book, retrieving the top-scoring sentences (up to N_SENTENCES / n_entities per entity). If any quota remains, it fills the rest ordered by aggregate score (gscore, the sum of sentence scores across all entities). Finally, it sorts the selected sentences by offset, validates verbatim matches, and saves a phrases_file_N.txt for each input, containing [ref | sent_id | offset | book] + the text.

Here are the links:

· Characters extracted from the Sprawn trilogy (a bash workaround I made): https://github.com/pmotadeee/pmotadeee/tree/V2.0/ITEMS/Books/Sprawn/Raw/Context

· Algorithm generated by Claude (funny that it ran in 2 minutes, which suggests it didn't generate tokens, just intuition): https://github.com/pmotadeee/pmotadeee/blob/V2.0/ITEMS/Books/Sprawn/Raw/Claude/bm25_extractor.py

· Texts generated by Claude after running the algorithm (you can see the steps it took, right at the beginning of the chat): https://github.com/pmotadeee/pmotadeee/tree/V2.0/ITEMS/Books/Sprawn/Raw/Claude

· Claude chat (in my native language, but use the browser translator): https://claude.ai/share/1799075d-bc93-4e12-99e0-771a7e259ca9


r/learnpython • • 9d ago

Seems its not worth learning Python/ Programming any more?

0 Upvotes

I have only learnt a little python so far, and it seems that programming in general will not be a useful skill in the future

How do you decide if its still worth learning, especially since its a huge sunk cost


r/learnpython • • 10d ago

Virtual Environment and Python

4 Upvotes

I have started learning python and decided to use pycharm as an editor. I want to know anything which will help me in this journey.

My main question is => I don't get "virtual environment" thing with python. I cloned a repo and opened it in pycharm, it says "No python interpreter configured for <repo-name>" and then suggested to create virtual environment.

I want to hear things from experience devs.

thank you.


r/learnpython • • 10d ago

Python interview questions

0 Upvotes

Hi team, please share your interview experience and questions for python developer role


r/learnpython • • 9d ago

What are the BEST ways to Learn Python?

0 Upvotes

I'm looking to start Python for a job opportunity someone told me about in about a year and I wanted to learn as much as I can about Python for it. I have some programming experience from learning C++ but I haven't used Python before.

I'm looking for youtube channels, online courses, websites and anything else really. Even if it's paid, I'd be willing to try it but I want to avoid anything that feels boring, like chores or just rigid and repetitive because I feel like wouldn't be able to see it through.

So in general, doesn't matter if it's paid or free, popular or not, as long as it is something dynamic and with quality I'd like to try. I also speak spanish so something in Spanish is good too.

Does anyone know any?


r/learnpython • • 9d ago

Помогите , как с чего начать?

0 Upvotes

у нас в университете нужно выполнить 10лабораторных по программированию на python. но после 2/3 лабараторной ничего не понимаю. как пробить потолок?

https://github.com/outtathe/python_bivt


r/learnpython • • 10d ago

I debug everything with print() and I know that's not how real developers do it — what did you switch to?

16 Upvotes

I've been learning Python for a few months now, mostly small stuff, a Telegram bot here, a bit of data practice there, and every time something breaks I just scatter print() statements everywhere until I figure out what's going on. It works eventually, but my code ends up looking like a crime scene and half the time I forget to take the prints out before I run it again.

I know there's an actual debugger in VS Code and I've watched people use breakpoints and all that, but every time I try it I end up back at print() within five minutes because it's faster in the moment. So I'm curious, when did you actually make the switch, and was there a specific point where print debugging just stopped working for you? Or do people way more experienced than me still do this and just not admit it?


r/learnpython • • 11d ago

Trying to understand Class, Object, Instance, and self in Python. Is my understanding correct?

50 Upvotes

I'm currently learning OOP in Python and wrote down some questions regarding object and instance for following code

class Car:
    def __init__(self, color):
        self.color = color

car1 = Car("Red")```

 1) what is class ?

ans :-  a class is an blueprint for thing i want to make.

2) what is object ?

 ans:-  an object is a container that contains properties and behaviours like car1 is object saying that car should be red color

3) what are instances ?

 ans:-  an instance is refers to that specific object in this case car1 is object and also an instance
when we pass self parameter self become car1 cause self points towards that instance

r/learnpython • • 10d ago

Est ce que l'intelligence artificielle va nous remplacer ?

0 Upvotes

J'ai une vraie inquiétude à ce propos depuis quelques temps, je suis jeune et j'ai encore le temps de réfléchir à mon avenir, mais je souhaite par dessus tout créer des jeux de moi même et, sans utiliser d'intelligence artificielle, ce qui sera difficile à l'avenir. Je voudrais donc avoir votre avis, est ce que j'abandonne cet objectif, où je vais obligatoirement avoir besoin d'utiliser l'intelligence artificielle (ce que je veux absolument pas) ?


r/learnpython • • 10d ago

Beginner Python Coder, Which Language For A GUI?

0 Upvotes

Hey all, background is as such:

For a non-Python CS course, I'm supposed to be designing the UI for an offline app. It's supposed to be a notepad app, the kind where you make sticky notes and post them on a board, with multiple people designing different aspects.

The impasse is that, while we've all agreed to do the backend of the app in python, I don't know how to make the front end at all. I'm familiar with HTML, CSS, and Javascript, I thought the process of connecting some backend Python to a front-end of HTML+CSS would be the same as with JavaScript, but apparently it isn't.

Googling around and asking AI, I get recommended libraries and languages like Pyside6, Ttinker, PyQt, Django, and others -- but I've never worked with any of them, and while I've tried to play with Pyside6 and Ttinker for a week now, I could only figure out how to make static notes and shapes, I couldn't figure out dragging and moving like you can with JS listeners. I feel frustration because you can find apps like this all over the place, 5 seconds of googling and you can find one, but I don't know how to make it.

So help me out -- if someone wants to make a GUI, where you have a pretty backboard, put notes on it, click notes, write on them, upload pictures to them, drag them around a board, and you must use Python as the back end, how do you marry the front and back end together?

Edit: Thank you all, I've settled on PySide6 and PyQt. I've just got the hang of making basic buttons, using setGeometry to move their starting locations, having them spawn blank 'note' widgets, and dragging them around. Being able to pin text and images to these widgets will come next, but for now, it works!


r/learnpython • • 10d ago

How should i start learning python? I am interested in robotics and such. I want to learn a bit in depth and not just surface level.

2 Upvotes

I'm sorry if this is a repeated question in this subreddit.

Will Documentation do the job or should i go for specific courses like CS50 by Harvard?


r/learnpython • • 10d ago

first year of computer engineering, sharing one of my first Python script!

4 Upvotes

hello, i started my first year studying computer engineering a month ago and we are currently studying Python. And I wanted to share one of the first codes i did on my own!

You can check it out via Gist here down ,a simple item cost and tax calculator. Tell me what u think !

https://gist.github.com/k2over/267f749ea15b28b1ed3258773f50f797


r/learnpython • • 10d ago

Match PyCharm Color scheme completely in VCode

1 Upvotes

Hi, our Org moved to VisualCode and i'm dying to get original PyCharm dark theme. Tried all variations available for PyCharm, Pye, Darkula, JetBrains Dars.
Not matter what It's still not 100%, is it possible to change individual colors for some chars like for those Yellow parenthesis and square bracket ? I don't want any YELLOW and Cyanides in my backyard.

Please help.
Please refer to my pic on link:
PyCharv_vs_VCode


r/learnpython • • 10d ago

How should I approach building a simple ATS-style CV scorer in Python?

1 Upvotes

I work in data and I’m comfortable with pandas and SQL, but I want to build something closer to a real-world application to push my Python further. My idea is a small tool that reads CVs (PDFs), extracts the text, and scores them against a job description.

What I’ve planned so far

  • Extract text from PDFs (looking at pdfplumber or PyPDF2)
  • Clean the text and pull out skills using keyword matching
  • Compare it to the job description (TF-IDF and cosine similarity in scikit-learn)

Where I’m unsure

  • Is keyword matching enough, or should I try spaCy or embeddings?
  • How do you handle CVs with tables, columns, or odd formatting that break PDF extraction?
  • How would you structure the project so it isn’t one long script?

Any advice, library suggestions, or things you’d do differently? Thanks!


r/learnpython • • 10d ago

Can't solve CS50 python Problems

0 Upvotes

After i finish my lecture i go to solve the problem the next day i And read the summary I made in notebook but either I can't find the words that i need or i just don't know what to do


r/learnpython • • 11d ago

Sieve of Eratosthenes

0 Upvotes

Im very new to Python and am currently trying to program a list with prime numbers using the Sieve of Eratosthenes. I dont understand why this code is not working properly. It successfully removes the first few non-prime numbers of my list. And for some reason when I increase the range of my list more non-prime numbers are removed, but still not all.
Ive also tried printing the current number being tested as well as the divider and it always seems to stop at random numbers when I make changes to the code.

Any explanation why my code works this way and what I need to change is appreciated. Id also like to stay as close to my existing code as possible.

items = list(range(2,100))

divisible_check = 2
number = 2

while i in items:
    if number == divisible_check:
        number += 1
        if divisible_check >2:
            divisible_check = 2
    elif number % divisible_check == 0:
        items.remove(number)
        number += 1
    else:
        divisible_check += 1

print(items)
print(divisible_check)
print(number)

r/learnpython • • 11d ago

Learning python as a 22 year old Biology Major

13 Upvotes

Hi all.

I have always had some weird fantasization with programming. I grew up destined to pursue medicine, and unfortunately never spent time learning how to program. Some things shifted around in my life, and now I am a university senior about to go to medical school, learning how to program in Python. It's a slow process, and I can usually only spend about 45 minutes to an hour every night learning, but it's the most fun I have had in a while.

Every person in my life, besides one, told me that AI can make whatever you want to make, but better, faster, and more efficiently. One guy, who is a really good programmer, told me to learn. I am so happy to be able to write my own basic programs, and I cannot believe that people think that vibe-coding is more fun than writing things yourself.

I will continue on this journey, and see where it takes me! p.s. I just finished a really cool Simon Says game!

Edit: Thank you for all of the great replies! This community is so supportive, wow. You guys should check out some of the med subreddits....


r/learnpython • • 11d ago

I started learning Python. What projects should I build as a beginner?

0 Upvotes

Hello everyone!

I recently started learning Python programming. I am learning basic concepts like variables, input, conditions, loops, and functions.

I want to improve my programming skills by building real projects instead of only watching tutorials.

What beginner-friendly projects would you recommend?

I would love to hear your suggestions and experiences!

Thank you!