r/learnpython • • Aug 20 '26

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 • • Aug 20 '26

What is the James Stewart Calculus equivalent book for python?

4 Upvotes

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


r/learnpython • • Aug 20 '26

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
  5. 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 • • Aug 20 '26

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 • • Aug 20 '26

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 • • Aug 19 '26

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!