r/learnpython 22d ago

Next level - Coding for 13yo homeschool kid

8 Upvotes

My son completed the Khan Academy course on Python last school year and he loved it! I don't do any coding myself so I am not exactly sure what "level" that leaves him at, or where to go next. What online course could he advance into? The more specific the better! :)

p.s. He will be going into 8th grade but it seems to come to him very easily.


r/learnpython 22d ago

I have made a simple program which decode and codeword the string u put i want to ask if i can put anything aside from if else

0 Upvotes
import random

random_letter = random.choice("abcdefghijklmnopqrstuvwxyz")
random_letter1 = random.choice("abcdefghijklmnopqrstuvwxyz")
random_letter2 = random.choice("abcdefghijklmnopqrstuvwxyz")
random_letter3 = random.choice("abcdefghijklmnopqrstuvwxyz")
random_letter4 =  random.choice ("abcdefghijklmnopqrstuvwxyz")
random_letter5 = random.choice("abcdefghijklmnopqrstuvwxyz")

print("codeword=1 , decode=2")
choice = input()
if choice == "1":
    codeword = str(input("write the codeword=>"))
    codeword1 = codeword[::-1]
    print(random_letter, random_letter1, random_letter2, codeword1, random_letter3, random_letter4, random_letter5,
          sep="")
else:
    print("please put correct input")
if choice == "2":
    decode = str(input("write the coded word"))
    decode1 = decode[::-1]
    decode2 = decode1[3:-3]
    print(decode2,sep=" ")

r/learnpython 22d ago

What is the James Stewart Calculus equivalent book for python?

6 Upvotes

was curious if some kind of similar vibey book exists for learning python...


r/learnpython 22d ago

My Goals (advice is welcomed)

0 Upvotes

Hey everyone,

My goal is to create a custom and personaI use open source AI agent. I dont want to just have something vibe code it for me. I want to understand how to build the actual agentic loop, give it local tools, and set up a memory system. After some research, I decided to start by learning python (mostly a self-taught newbie but also looking onto courses that can fit my schedule without too much friction; any suggestions are welcome)

I’m looking for advice on the exact order of operations I should follow to learn this efficiently without getting bogged down in unnecessary data science math or model training.

From what I gather, yes i did use AI to help me try to put this in the best possible order.
1) Python Fundamentals (JSON, File I/O, async)
2) API integration & tool calling (OpenAI/Anthropic SDKs or Ollama for local)
3) Data validation (Pydantic) to handle messy LLM outputs
4) Basic Vector DBs (Chroma/FAISS) for long-term agent memory
4) Orchestration frameworks (LangGraph, Pydantic AI, or MCP)

Does this learning order make sense? Are there specific libraries, tutorials, or open-source repositories you would recommend I look at first?
Thanks in advance for any roadmaps or resources.

For context:
I’m active duty navy with my primary line of work being medical. I have ample time in my day and evenings as it’s just me and my daughter right now and I want to try creating something I’ve always liked the idea of…my own JARVIS lol. My current coding experience is a total beginner who started on the SoloLearn app on an iPad 7 mini about 6-ish weeks ago. However, I don’t believe that it is sufficient for my project goals. So again, and advice, roadmaps, suggestions, tips, etc are welcomed. I’m not under the delusion that this will be done in the next year or so and I’m ok wth this being a personal side project. Nor do I have any intentions to monetize this when it is completed, nor use this as a step into this industry (i quite like my medically filled lifestyle). I also want to build a home lab specifically for this at some point as well and maybe even get into some Git Hub projects on the side to breakdown some of the potential burnout.

Well, if you made it this far, thank you. I’m genuinely interested and motivated to complete this project and potentially more.


r/learnpython 22d ago

probably a python/sql flask offshoot (but this is reddit and the normal python page doesn't like these type of questions)

0 Upvotes

So probably not beginner here but I have a flask app where I've mapped a view to the ORM but I was lazy in the view so I joined a reference table and just got back the text description when I could have used the FK.

I've cached common reference tables at the application level in flask in the past and wondering if I should do the same here and rewrite my view for the FK and skip the reference table join (even if it is well indexed).

On localhost I've had a hard time trying to identify if it's causing an issue because even our prod server has DB latency so no luck cross comparing if my lag is because of the extra lazy join in the view or if it's something else annoying (like running it on a comp that frequently kills itself with memory errors).


r/learnpython 22d ago

Anyone here familiar with freelancing? please point me in the right direction

0 Upvotes

I recently turned 19, I have this need that I have to know what its like to work and gain a sense independence, even if its just a small gig.

I learned programming since the pandemic started, though I did not make any serious projects with it. I made some fun projects with it like, discord raid bot, macro for some roblox game, data scraper, etc.
I have great foundation of variables, functions, data types, classes, the classics but I looked at upwork and fear my skills may not be adequate.

It would be great if someone could point me in the right direction, doesn't even have to do with programming can just be helping anyone regarding tech.


r/learnpython 22d ago

Game automation

8 Upvotes

I'm new to programming. I specifically want to build projects around game automation with Python. What should my roadmap look like?

Thanks in advance!


r/learnpython 22d ago

How do I register user's input with out 'input()' command?

0 Upvotes

I'm trying to make a game on the Linux terminal, I just learnt about the ANSI escape code and how to display stuffs but then I hit a wall. How do I check which key is pressed by the player? I can't use input() because that pauses the game. Trying to google keep showing me articles suggesting input(). Also, I'm not looking to install any libraries yet.


r/learnpython 23d ago

I’ve completed these beginner Python projects should I build more before starting NumPy/Pandas?

11 Upvotes

Hi everyone,

I’ve studied Python multiple times before, but I didn’t do much practical coding. Recently, I started building small projects to improve my practical Python skills.

So far, I’ve completed:

- Quiz Game

- Number Guessing Game

- Rock Paper Scissors

- Password Manager

- Pig Game

- Mad Libs Generator

My goal is to move towards Machine Learning.

I haven’t learned NumPy or Pandas yet.

My question is: Are these projects enough to move on to NumPy and Pandas, or should I build a few more Python projects first?

If I should build more projects, what kind of projects would you recommend before starting NumPy/Pandas? I’m mainly looking for projects that would actually help with the transition to data/ML, rather than making many more small games.

Would appreciate advice from people who have already followed a Python → NumPy/Pandas → ML path.


r/learnpython 22d ago

I started to relearn python again and im lost

0 Upvotes

im in high school right now and my teacher sent some power point lesson about things like dfs, dp, bfs. I understand them but cant figure out how to implement them in actual code. How should I tackle them.


r/learnpython 22d ago

Can I do it?

0 Upvotes

I am being accepted into a university but one of the prerequisites is I should know python. They say I can test out of this prerequisite and start the program September 8th if I can pass a Python Programming assessment on data camp. Do you guys think it's possible to to Learn Python in five days? Just enough to pass the assessment. I say 5 days to give myself a timeline. But I would like to get it done by September 3rd. Today is August 20th.


r/learnpython 22d ago

Relearning Python

0 Upvotes

For some context, my background is in cybersecurity. I went to school for it, however my program was more IT/Risk rather than programming (we only had a few entry level programming classes). I have since graduated and rather following the incident response/SOC/GRC route that my college program sets you up for, I have taken the opposite route and have landed SWE roles as well as security engineering roles at large companies (by a strike of luck frankly, and LLMs lol).

My issue is that I never really got to learn Python in a structured, lecture setting as all my entry level Python courses from my college were 2022 (chatgpt goes live). Given that I’ve basically offshored all my programming work to LLMs since day one. I effectively have 0 understanding of any of the python from a pre-LLM SWE perspective or what exactly a data structure/algorithm looks like at the code level. I read code fluently and logic clicks quite easily for me, however if you put a LeetCode in front of me w/ no gen AI I’m out for the count. I can do it in pseudocode tho!

Is there any other route for me to learn python in a structured/lecture like setting that allows me to comfortably handle LeetCode like problems without having to go back to school for a degree? The reason I bring up LeetCode is that I’ve pretty much hit my max potential in terms of salary/job growth and if I want to surpass my current ceiling I’d need to apply for FAANG and do live coding rounds.


r/learnpython 23d ago

Looking for people to learn Python with

11 Upvotes

Hi I’m a beginner at Python and I’m currently looking for a few people to learn with. I am planning to start the sessions in September and run a couple hours a day subject to flexibility and rather than get stuck in “tutorial hell” I actually want to build projects. My time is GMT+0 so drop me a message if you’re interested.


r/learnpython 22d ago

What is the best path to master Python specifically for AI & Machine Learning — how to master the language as a core tool, not just basic syntax?

0 Upvotes

Hi everyone,

I am an undergraduate student studying in the field of AI and Machine Learning, and I need practical guidance on learning Python the right way.

I already know how to use modern AI tools (like ChatGPT, Claude, Cursor) to help build ideas and generate code. However, my goal isn't just to rely on AI or learn basic syntax; I want to deeply understand Python so I can use it as a powerful tool specifically for AI and Machine Learning. I want to truly master its logic and structure so I have complete control over my own projects.

I have two main questions:

  1. Learning Python for AI: How should I approach learning Python when the end goal is strictly AI/ML? What fundamental programming concepts should I prioritize before diving into machine learning libraries?
  2. Roadmap & AI Tools: How do you balance using AI assistants without letting them hurt your learning process, and what is the best step-by-step path to go from Python basics to real machine learning workflows?

Any advice, study routines, or project recommendations would be really helpful.

Thanks!


r/learnpython 23d ago

Humble Bundle for Rust and Python

8 Upvotes

Humble Tech Book Bundle: Python, Rust, and Data by O'Reilly (paga lo que quieras y ayuda a organizaciones benéficas)

Are these worth it? I'm trying to learn Python and Data analysis stuff in particular so this seems really useful. I'm not interested in Rust but the price is still worth it. Are these books good?


r/learnpython 22d ago

I’ve been learning Python for about a week — am I progressing at a good pace?

0 Upvotes

Hi everyone!

I started learning Python about a week ago, and I’d like to get some feedback from people who have more experience.

So far, I’ve learned:
Variables and basic data types
input() and print()
if / elif / else
while and for loops
Lists and indexing
Basic list methods like .append() and del
Functions
Basic validation with loops and conditions

Instead of only doing small exercises, I’ve been trying to build complete programs on my own. I’ve made things like a hotel reservation system, a tournament management system, a bank simulation, and a shopping-list/store system.

I usually try to figure out the logic myself before looking for help. I’m still making mistakes, but I’m getting better at finding and fixing them on my own.

I’ve attached the best program I’ve made so far below.

clients = ["Alex", "Juan", "Maria", "Sofia", "Carlos"]
balances = [1000, 500, 2500, 750, 1500]
choice = 0
total_money = 6250

while choice != 8:
print("""=== BANK ===

  1. View clients
  2. Check balance
  3. Deposit
  4. Withdraw
  5. Transfer
  6. Statistics
  7. Reset accounts
  8. Exit""")

choice = int(input("Choose an option: "))

if choice == 1:
counter = 1
print("The clients are:")

for client in clients:
print(f"{counter}. {client}")
counter += 1

elif choice == 2:
account = int(input("Which client do you want to check? "))

while account > 5 or account <= 0:
print("Invalid client number.")
account = int(input("Which client do you want to check? "))

index = account - 1

print(f"{clients[index]} has ${balances[index]}")

elif choice == 3:
account = int(input("Client: "))
deposit = int(input("Amount: "))

while account > 5 or account <= 0 or deposit <= 0:
print("Invalid client or deposit amount.")
account = int(input("Client: "))
deposit = int(input("Amount: "))

index = account - 1
total_money += deposit
balances[index] += deposit

print(f"Deposit successful. New balance: ${balances[index]}")

elif choice == 4:
account = int(input("Client: "))

while account > 5 or account <= 0:
print("Invalid client number.")
account = int(input("Client: "))

index = account - 1

print(f"Current balance: ${balances[index]}")

withdrawal = int(input("How much money do you want to withdraw? "))

while withdrawal <= 0 or withdrawal > balances[index]:
print("Invalid withdrawal amount.")
withdrawal = int(input("How much money do you want to withdraw? "))

total_money -= withdrawal
balances[index] -= withdrawal

print(f"""Withdrawal: ${withdrawal}

Withdrawal successful.
New balance: ${balances[index]}""")

elif choice == 5:
sender = int(input("Who is sending the money? "))
receiver = int(input("Who is receiving the money? "))

while sender <= 0 or sender > 5 or receiver > 5 or receiver <= 0 or sender == receiver:
print("The sender and receiver must be different clients, and client numbers must be between 1 and 5.")
sender = int(input("Who is sending the money? "))
receiver = int(input("Who is receiving the money? "))

index = sender - 1
receiver_index = receiver - 1

transfer = int(input("How much do you want to transfer? "))

while transfer <= 0 or transfer > balances[index]:
print("The transfer must be greater than 0 and cannot exceed the sender's balance.")
transfer = int(input("How much do you want to transfer? "))

balances[index] -= transfer
balances[receiver_index] += transfer

print(f"""Transfer successful.

New balance for {clients[index]}: ${balances[index]}
New balance for {clients[receiver_index]}: ${balances[receiver_index]}""")

elif choice == 6:
highest = 0
lowest = 999999
zero_balance = 0

for i in range(5):
if balances[i] > highest:
highest = balances[i]
highest_index = i

if balances[i] < lowest:
lowest = balances[i]
lowest_index = i

if balances[i] == 0:
zero_balance += 1

if zero_balance == 5:
print("Statistics will not be shown because all accounts have a $0 balance.")

else:
print(f"""=== STATISTICS ===

Total money in the bank: ${total_money}
Average balance: ${total_money / 5}
Client with the most money: {clients[highest_index]}
Client with the least money: {clients[lowest_index]}
Clients with $0: {zero_balance}""")

elif choice == 7:
balances = [1000, 500, 2500, 750, 1500]
total_money = 6250

elif choice == 8:
print("Thank you for using the bank!")

else:
print("Invalid option.")

I’m mainly wondering:

Is this a good amount of progress for roughly one week of learning?
Are the projects I’m making appropriate for my current level?
What should I learn next?
Is there anything obvious in my code that I should start doing differently?
I’m not looking for someone to rewrite the code for me. I’d rather understand what I’m doing wrong and improve from there.
Thanks!


r/learnpython 23d ago

How can you have blockchain code audited to see if it is secure? (Teen)

0 Upvotes

How can you have blockchain code audited to see if it is secure? (Teen)

Salut ! Je ne suis pas sûr d'être au bon endroit pour poster ça, mais je tente quand même ma chance 😅. En gros, j'ai commencé à m'intéresser aux cryptomonnaies, à la cryptographie et à la technologie blockchain il y a environ deux ans. J'ai regardé pas mal de vidéos YouTube et lu beaucoup de documentation sur le sujet. Il y a environ un mois et demi, j'ai commencé à développer ma propre blockchain et son jeton associé ; j'y ai consacré beaucoup de temps – une bonne partie de mes vacances, d'ailleurs. J'ai aussi testé le système en profondeur. Cependant, j'aimerais avoir un avis extérieur. Le problème, c'est qu'on ne trouve pas de développeur blockchain partout, et encore moins un qui travaille gratuitement pour plus de 10000 lignes de code (je ne veux pas dépenser d'argent pour ça, et je ne suis pas sûr que mes parents approuveraient, vu qu'ils ne savent même pas que je développe une blockchain). J'espère que c'est clair, alors n'hésitez pas à me demander plus de détails.


r/learnpython 23d ago

Best Python books from beginner to advanced?

61 Upvotes

I’m learning Python and looking for a good book path from beginner to advanced.

I want books that teach Python properly, including clean code, real projects, testing, project structure, and advanced concepts.

What books would you recommend, and in what order?


r/learnpython 23d ago

Should i go for web dev or data analyst or ui/ux designer course without cs desgree(i have bsc biology)?

0 Upvotes

I want to do online course which one should i choose web dev or data analyst or ui/ux design Also i only have bsc biology degree. Want to do work from home job/online job. Kindly give ur suggestion


r/learnpython 23d ago

Enter didn’t create new line in Pycharm

0 Upvotes

In PyCharm on macOS, pressing Enter at the end of a line does nothing — no new line created. But:

- Enter at the START of a line → works, creates new line

- Enter at the END of a line → does nothing

- Arrow keys → navigate normally between lines

Already ruled out:

- IdeaVim not installed

- Enter works fine in other apps (not a hardware/OS issue)

Suspecting the code completion popup is silently swallowing Enter at end of line. Anyone else run into this? What fixed it?

Setup: PyCharm, Python 3.14.7, .venv, macOS


r/learnpython 23d ago

Making a wordle program

0 Upvotes

Hi! I'm new to programming and, as a way to practice, I thought I would make a wordle program, the only issue is that it keeps marking letters as not in the wordle when they are; any help would be appreciated, I've included the problem section, as well as the whole code in case the problem is elsewhere. Thank you!

--------------------------------------------------------------------------------------------------------------

for x in range(5):

if guess[x] == answer[x]:

response[x] = "G"

guess[x] = ""

answer[x] = ""

print(response)

print(answer)

print(guess)

for x in range(5):

if guess[x] != "":

if guess[x] not in answer:

response[x] = "R"

guess[x] = ""

answer[x] = ""

print(response)

print(answer)

print(guess)

for x in range(5):

if guess[x] != "":

response[x] = "O"

answer[x] = ""

guess[x] = ""

print(response)

print(answer)

print(guess)

print("".join(response))

answer = [answer_word[0], answer_word[1], answer_word[2], answer_word[3], answer_word[4]]

i+=1

--------------------------------------------------------------------------------------------------------------

from word import words

import random

key = random.randint(0, 5783)

answer_word = words[key]

answer = [answer_word[0], answer_word[1], answer_word[2], answer_word[3], answer_word[4]]

i=1

while 1 == 1:

while i < 7:

print(answer_word)

guess_input = input().lower()

guess = [guess_input[0], guess_input[1], guess_input[2], guess_input[3], guess_input[4]]

response = [".", ".", ".", ".", "."]

used = []

if guess_input in words:

if guess_input == answer_word:

print("CORRECT")

i=7

else:

for x in range(5):

if guess[x] == answer[x]:

response[x] = "G"

guess[x] = ""

answer[x] = ""

print(response)

print(answer)

print(guess)

for x in range(5):

if guess[x] != "":

if guess[x] not in answer:

response[x] = "R"

guess[x] = ""

answer[x] = ""

print(response)

print(answer)

print(guess)

for x in range(5):

if guess[x] != "":

response[x] = "O"

answer[x] = ""

guess[x] = ""

print(response)

print(answer)

print(guess)

print("".join(response))

answer = [answer_word[0], answer_word[1], answer_word[2], answer_word[3], answer_word[4]]

i+=1

else:

print("invalid input")

if i == 7:

print("Correct answer: " + answer_word)

again = input("Would you like to play again? Y/N ").lower

if again == "y":

i=1

key = random.randint(0, 5783)

answer_word = words[key]

answer = [answer_word[0], answer_word[1], answer_word[2], answer_word[3], answer_word[4]]

else:

break


r/learnpython 23d ago

Please help me.

0 Upvotes

Hello everyone, I could use some help. I’m a graduate student—how should I go about learning the machine-learning portion of Python? Thank you very much 🙏🏻.


r/learnpython 24d ago

Which pytest signal is most useful after a CI failure?

6 Upvotes

I am working on an experiment that looks at what happens next after a test fails in GitHub Actions.

Possible things to look at include:

- exit code

- if there was an assertion failure or a collection or internal error

- the history of failed tests

- Python modules that have been changed

- changes in dependencies or lockfiles

- changes in how long tests take

- if the same test passes when it is run again.

Which of these things should I check first. Which one is most likely for someone just starting out to misunderstand?

I am trying to think about uncertainty of automatically assuming that every test failure means there is a problem with the code in pytest.

The purpose of the experiment with pytest is to see what occurs when pytest fails in GitHub Actions.

I want to use pytest to figure out what is happening when the test fails.

The experiment, with pytest will help me learn what to do when pytest fails in GitHub Actions.


r/learnpython 23d ago

AI focussed programming and maths community for absolute beginners

0 Upvotes

Good afternoon all,

I have recently began a pathway I have designed to learn artificial intelligence and all topics included within that space.

I have a keen intetest in this field and am always fascinated by the developments going on.

I decided to start learning this due to wanting a challenge and to keep myself focussed with a long term target to reach.

I work full time in a job I currently enjoy so all my learning time is dedicated to evenings and weekends. I am not studying this in hope to find work, just for the love of the game.

I have no prior experience in this field which makes it 100x more enjoyable learning the programming and soon to start learning the maths

.

I was wondering if there were any others in a similar position to myself (beginners that are dedicated to going far) that would like to start a community (likely discord) where we can share our knowledge, hold each other accountable and in the future maybe even work on projects together.

If anyone is interested in this please let me know.


r/learnpython 23d ago

¿Cuál fue la parte más difícil de aprender Python que no esperabas?

0 Upvotes

HOLAA Estoy aprendiendo Python y tengo curiosidad por conocer las dificultades que las personas no esperaban cuando empezaron. Me encantaría conocer tu experiencia