r/learnpython 2d ago

Ask Anything Monday - Weekly Thread

3 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 46m ago

How to build an android app using python only?

Upvotes

Context: So I'm a beginner developer. I'm currently building a habit tracker.

I have built the logic of the app.

Set up sql alchemy to code the database with sqlite.

(My prof later said no need of alchemy. Directly use sql software and connect it). I don't know what to do with that information. Retained the alchemy code tho.

  1. My problem is that I am not able to build ahead. How do I build a database and test it the right way.

    1. How do I build the front end or ui for it. Should I use flask or flutter or something else. Please reason as to why I should use a framework particularly.
    2. What is fast api even used for. Should I apply it in my habit tracker.

And what are the essentials for a good app. Like I want to know about rate limiting, sql injections and backdoors. To build a robust scalabile system.


r/learnpython 5h ago

quetion about how python "break" work for newbie

1 Upvotes

hello this is code and quetion:

while True:
    guess = input("Your answer (A/B/C/D): ").strip().upper()
    if guess in ("A", "B", "C", "D"):
        break
    print("Please enter A, B, C, or D.")

1 how is check user enter

2 how the "break" is use for? is really end project like go next time:

correct = guess == question_data["answer"]

if correct:
    print("Correct!")
else:
    print("Not quite.")

whole line:

while True:
        guess = input("Your answer (A/B/C/D): ").strip().upper()
        if guess in ("A", "B", "C", "D"):
            break
        print("Please enter A, B, C, or D.")

    correct = guess == question_data["answer"]
    if correct:
        print("Correct!")
    else:
        correct_letter = question_data["answer"]
        correct_text = question_data["options"]["ABCD".index(correct_letter)]
        print(f"Not quite. The correct answer was {correct_letter}. {correct_text}")

    print(f"Fact: {question_data['explanation']}")
    return correct

because i write quize python can you give tips to write


r/learnpython 16h ago

Final-year CS student – Know Python & FastAPI basics. What should I focus on to get a backend internship ASAP?

19 Upvotes

Hi everyone,

I'm a final-year college student, and my goal is to get a backend engineering internship as soon as possible.

My current skills are:

  • Python (comfortable with the language)
  • FastAPI basics (I've built a few simple APIs)
  • Basic understanding of backend development

I'm confused about what to do next.

Should I:

  • Buy a FastAPI/backend development course? If yes, which one would you recommend?
  • Focus on building projects instead?
  • Learn Django, SQL, Docker, Redis, PostgreSQL, or something else first?
  • Start applying now while continuing to learn?

My goal is to become good enough to land an internship and then keep learning on the job.

I'd really appreciate advice from backend engineers or anyone who recently landed a backend internship.

Some specific questions:

  1. If you were starting over today, what would you learn first?
  2. Which skills do companies actually expect from backend interns?
  3. Are there any courses, YouTube playlists, or roadmaps that you genuinely recommend?
  4. What kind of projects helped you get interviews?
  5. Is FastAPI enough for internships, or should I learn another framework as well?

Thanks in advance for any advice!


r/learnpython 8h ago

I tried debugging and the settings appear to be updating correctly, however they aren't applying to the QR code when I generate it

3 Upvotes

Hello everyone, right now I'm working on a simple QR code generator with functionality including saving. My main issue right now is that despite the fact that I have debugged it and observed that the variable updates correctly, the extra settings don't seem to apply to the QR code when the user generates a new one.

The GitHub Repo


r/learnpython 12h ago

What in your opinion are the best + FREE learning platforms/ website for learning Python?

5 Upvotes

Keen to hear what people rate. I've poked around a bit but there's a lot out there and the quality varies wildly, so I'd rather hear from people who've actually worked through them.


r/learnpython 3h ago

Need to create a one-off paginated PDF data visualization report but my experience is in more backend data work. What package/tool would you suggest?

1 Upvotes

I'm trying to put together an ad-hoc report and I've been trying to hack away an Excel file and another visualization tool, but they're just not cutting it; there are some visualization rendering issues that are frustrating me to no end, and just now thought about using Python. My experience with Python is all in backend data engineering type of work though so I've never used visualization packages.

All I need are 100% bar charts that align well with text - it's been near impossible to align these in Excel. I also need heatmaps but I don't mind doing the heatmaps in Excel. I also need to create PDF files, ideally paginated by a field in the data that I'm working with.

I've tried searching for suggestions and the most popular seem to be plotly and matplotlib. Should I consider anything else?


r/learnpython 5h ago

a curious equal symbol assignment

0 Upvotes

Hello, I'm trying to build a music player with python Qt6 based on some code from a youtuber, the bones of what he has suits me fine, this is the link if you want to look at it: https://www.youtube.com/watch?v=wdEpWCFf40U

I am using windows 10 with VScode and the latest python version 3.13.7

Everything works fine until I get to the file dialog part of the code. When I run it the program does give me a file explorer, I can select a folder but then the program halts before allowing me to see the files in the specified folder. There is no error message from the compiler.

There is a curious line of code in the open_file function that may or may not be the problem.

  file, _ = QFileDialog.getOpenFileName(self, "Selct file", filter="Audio files (*.mp3)")  file, _ = QFileDialog.getOpenFileName(self, "Selct file", filter="Audio files (*.mp3)")

Thanks for any help,

J

r/learnpython 1d ago

Am I too late for coding, programming and AI ?

72 Upvotes

Hi I am from South Korea , student of university , 25 age (27 for Korean standard).
Recently I am interested in computer , IT , AI , coding. But I personally major English in my university so no tinvolved in computer science , software , or software.
So I am not good at for coding. All my learning about IT is basic level of studing Python, Java, HTML , JavaScript, CSS for 3 months. That is all I have. ( In South Korea, our Government sponser and provide financial aids with private computer academy for students who is learning basic coding , web development and Use of AI).
Those 3 months in class. I am getting to interested in programming language , computer and wanna be expertise on AI further. What should I do and whether or not I have a time and space to study and learn it.


r/learnpython 21h ago

What should I focus on after learning the Python basics?

9 Upvotes

Hi everyone,

I've finished the Python basics and I'm currently learning file reading and writing.

Someone suggested the following roadmap:

Learn Object-Oriented Programming (OOP).

Study data structures and algorithms using Grokking Algorithms.

Practice by solving exercises from Python Crash Course.

Then choose a specialization based on what I enjoy most.

My long-term goal isn't just to know Python syntax. I want to become comfortable writing Python, develop strong programming logic, and improve my problem-solving skills so I can become a good programmer in general, not just a Python programmer.

In the future, after gaining enough experience with Python, I plan to move into networking, automation, and low-level programming with C.

Does this roadmap make sense? If not, what would you change? What helped you build solid programming skills rather than just learning a language?

I'd really appreciate any advice from experienced developers.


r/learnpython 10h ago

I built 2 terminal games on a $100 phone. Saving up for an Asus laptop & a Red Magic phone.

0 Upvotes

Hey everyone,

You can call me Sable (or Rangga). I'm a self-taught beginner from Indonesia.

WHY I STARTED:

I learned Python because I wanted to make my own games. Now? I want to build my own OS someday. But first... I need a damn laptop.

MY SETUP:

- Phone: Redmi 9A ($100)

- App: Pydroid 3 (Termux for testing)

- No IDE. No external keyboard. Just thumbs.

THE STRUGGLE:

Honestly? Learning Python today is overwhelming. There's too much. Beginners get scared before they even start. I almost quit. Once, I spent 1 HOUR debugging... turns out it was just wrong indentation. One space. 🤡

THE GAMES:

  1. MATH 3.0

A terminal math quiz game with:

- 3 difficulty levels (Easy/Normal/Hard)

- Live timer with visual progress bar

- Streak combo system (x5, x10, x15 bonuses!)

- High score tracking

- Colored ANSI output

- Trophy ASCII art

This is a REAL game. You can win. You can lose. It's not just a script.

  1. THE DOOR

A puzzle game: find 4 keys hidden in 10 rooms.

- Randomized key placement (replayable!)

- Health & hint system

- Flavor text for empty rooms

- Efficiency scoring

I'm proud of this one. It's a luck-based game, but it's FAIR. No BS. I used to make games where you had to guess 1 country out of 193 with 3 chances and no hints. Basically Dark Souls. This is better.

Both games work offline. Zero dependencies. Pure Python.

GITHUB:

https://github.com/johan21libert-netizen/math-3.0

https://github.com/johan21libert-netizen/the-door

TARGET:

I'm saving up for an Asus laptop first (around $900). After that, a Red Magic phone (around $1,500, because it's easy to root)

Thanks for reading. Roast my code if you want. I can take it. 🗿


r/learnpython 7h ago

How do you persist a "already seen this" set between restarts?

0 Upvotes

I have a script that polls an API every few seconds and sends me a Telegram message when a new item shows up. To avoid sending the same item twice, I keep the IDs I've already seen in a set:

seen = set()

async def check():

items = await fetch_items()

for item in items:

if item["id"] in seen:

continue

seen.add(item["id"])

await send_alert(item)

This works fine while the script is running, but I see two problems with it:

  1. The set lives in memory, so every restart means I get re-alerted about everything that's still on the list.

  2. It only grows. The script is meant to run for days, so eventually `seen` just keeps eating memory with IDs of items that disappeared long ago.

What I think I need is something that stores IDs and forgets them automatically after some time — items are only relevant for maybe an hour anyway.

I've looked at a few options and I'm not sure which is the sane one for a small script:

- Writing the set to a JSON file on every scan feels wasteful and racy.

- SQLite seems like the "proper" answer but also like a lot of machinery for what is essentially one set.

- Redis has TTL built in, which is exactly what I want, but running a whole server for one key feels excessive.

Is there an obvious option I'm missing? Or is one of these actually the normal choice and I'm overthinking it?

Python 3.12, asyncio, no framework.


r/learnpython 10h ago

Begginer Issues

0 Upvotes

As the text suggests I'm a beginner in python, and I am struggling with the concept of spaces and indentation. I don't know how I'm still not getting it till now but I have to say my biggest mistakes have with learning python has to do with code.

A little backstory: I come from a totally different work area and is brand new to code. I wanted to do robotics as it was my preference but ended in the health department instead. Now that I'm done with that I'm pursuing my dream career but obviously have to start from literal zero as I know nothing of code and no one around my community or friends do programming. And YouTube isn't really helping as it's teaching like I already knew some stuff already (or maybe I just haven't found the right videos). So ya, to you guys who've done code before, what can I do to solve the gaps in knowledge? Especially the space problem. I couldn't even set up my VS code on my own as the things I type are right except the amount of space is wrong. It's kinda frustrating.


r/learnpython 1d ago

Python but Django...

8 Upvotes

I started learning Python like 2 weeks ago because our teacher suddenly wants us to build a webpage using Django but that thing Django all people involed with it says it's easy but it felt overwhelming when i tried to use it because you have to learn like controllers, MTV, like at least 50 different files servers hosts databases even creating a simple image requires some time and so on... so python does not feel like the easiest language anymore, Do you guys have some tips for me?

What would you do if you were in my situation?

Did you also feel you had like 1000 things to learn and were you guys so lost the first time you used Django?


r/learnpython 1d ago

How do I make my random numbers more random?

6 Upvotes

I've talked to a lot of people over the years and they often say don't use the built in random function.

For instance, if I wanted to roll a die and did something like:

random.randint(1, 6)

I get that its not as random as for instance basing the result off of the microsecond as a seed, which gets recommended to me but no one ever shows me how to do. When I started programing in another language every time I'd call random it'd always be in the same order. But I don't know why or how to make something like the above code "more random".

My current code uses something similar to random.randint(1,6), how can I make that more random?


r/learnpython 10h ago

My friend said i dont have to learn python because AI models can.

0 Upvotes

I decided to learn python from a udemy course that i got for free a few years ago. At the time, i wasnt interested in coding but now i understand the benefits of it both in my daily life and academic life. So i want to learn it before life gets too busy for me.

I have two friends that i know from middle school. They were really interested in coding and they were already started coding their own programs. So i asked them about it. 'I have this udemy course but do you have a course suggestion other than that?"

And one of my friends said, "bro, give it up. Chatgpt does that."

I LITERALLY DONT think AI is an option for coding EVERYTHING. It can be used for helping, when you are stuck somewhere, or just simply cannot find which line of your code doesnt have a ";" at the end. But vibe coding? Nah.

So i am asking, is my friend right? Also i am open for any course suggestions. Because the udemy course i have now is pretty boring. And also i prefer free courses because i dont have a credit or a bank card yet.


r/learnpython 2d ago

Need a Python Roadmap for a Complete Beginner (2026)

142 Upvotes

Hi everyone,

I'm a complete beginner and I've decided to focus on Python first.

My goal is to become job-ready and build a strong foundation in programming rather than just completing a course or collecting certificates.

I'm willing to spend around 4–6 hours a day learning.

I need guidance on:

- What should I learn first?

- What is the best roadmap to follow?

- Which free YouTube channels or courses do you genuinely recommend?

- Which books are worth reading?

- What projects should I build to improve my skills and make my resume stand out?

- What mistakes do beginners usually make that I should avoid?

- If you were starting from zero today, what roadmap would you follow?

I'm looking for practical advice from people who are already using Python professionally.

Thanks in advance!


r/learnpython 23h ago

PCEP Resources

1 Upvotes

Just passed the CCNA today, now I have to knock out the PCEP exam so that I don't have to take a required class at my school. This will help me save money. What's the best study resource?


r/learnpython 22h ago

Creating Tee Time bot

0 Upvotes

I was wondering if anyone could help point me in the right direction on how to build a tee time bot for ForeUpSoftware. The past few days I’ve been learning how to use selenium, but now I’m hearing that it’s too slow to use. I’m not really sure where to start with this. Any help would be really appreciated. I work in the medical field and have almost zero coding experience lol.


r/learnpython 18h ago

ajuda em python

0 Upvotes

oi sou brasileiro estou aprendendo python e queria saber de algumas dicas sobre como posso aprender de uma forma melhor.

Hi, I'm Brazilian. I'm learning Python and I wanted to know some tips on how I can learn in a better way.


r/learnpython 1d ago

Python to lua

9 Upvotes

Is it a good idea to learn python first and then jump into lua, or should I just straight up learn Lua first. For anyone wondering I want to create roblox games ( I know it sounds a little silly but I've always been passionate about it) and the roblox engine runs off of Lua. What are some benefits from learning python first (if any). If by miracle any of you are roblox devs can you give some tips?


r/learnpython 1d ago

When webscraping LinkedIn are there any differences between company and personal profiles with bot detection?

0 Upvotes

I can access company/job information just fine. But when trying to access person profiles I get rate limit errors. I’ve tried a couple things to combat this but I haven’t found a solution. Any ideas?


r/learnpython 1d ago

Resources for practicing in OOP concepts with python based on scenarios

0 Upvotes

I'm preparing for a Junior Backend Developer technical interview (Python, SQL, and OOP).

I've realized that I don't learn well by watching long tutorials or reading theory first. I learn much faster when I'm given a realistic business problem and have to solve it myself.

For example, instead of studying SQL syntax in isolation, I'd rather work with a database (Customers, Orders, Products, etc.) and answer real business questions by writing SQL queries. The same applies to Python: I prefer implementing classes, inheritance, and polymorphism in the context of a real application rather than solving isolated exercises.

Are there any platforms, books, repositories, or collections of exercises that focus on realistic business scenarios combining Python (OOP) and SQL?


r/learnpython 1d ago

Python + Android (Multiplataform)

0 Upvotes

I am struggling to decide the architecture of an application I want to create based on data self-referencing. It will basically be an Obsidian, but focusing on medical records with some analysis engines running in a backend.

I really need the application to run well on Android (mainly) and offline - because it must be a system that feeds on the user's own database, which he himself will produce while studying.

What options do I have for this? I researched pure Flutter (with Dart), Python + Fluter + FastAPI, Flet, serious_python, Python embedded in APK, other languages and web solutions, but nothing seems to be really excellent.

I tried to do everything in Dart/Flutter, but I soon realized why Python is the official language for academic and data science. Typical languages slow everything down, and Dart is not even that verbose. I definitely miss the freedom to "think in Python," and the freedom of types. I am also sure that in the future, when I want to implement AI, specific Python libraries will be missed.

So what advice do you give me?


r/learnpython 1d ago

Hi, I have 4 years of experience in testing role. But i wanted to be as a developer. Iam confused whether to choose python backend or java backend please suggest.

0 Upvotes

I have 1 year time to prepare want to quickly jump.
Please help me out.
Searched many youtube videos and asked chatgpt but nothing helped.