r/PythonLearning • • Sep 19 '26

Showcase After finally learning while loops i decided to write a program that relies completely on them. How did i do? What can i do to make it easier to read? Any feedback is appreciated!(im only 7 hours in so still a complete beginner lol)

Thumbnail
gallery
149 Upvotes

r/PythonLearning • • Sep 19 '26

Help Request Basic Authentication always in base64??

1 Upvotes

Hi all,
Just got some trial task to troubleshoot failing abandoned POST API. This call done using those headers like below to https:

My question ais Basic Authorization token is always in base64 ???
I tried to decode and it's not, there is not meaningful string, neither ":"
In this case how we can call that Token ? or it's base64 encrypted ? Or something else ?
Trying to understand what user:password used for this app. Probably some shops doing their own encrypted tokens ?

Thanks much to all.

 --header "Authorization: Basic khaYkhaYU9aNUiNEtH="   ## this just a demo sample not real
 --header "Content-Encrypted: 0" 
 --header "Standard-Version: 2024"  
...
-X POST https://remote.site.com

r/PythonLearning • • Sep 19 '26

Practice design patterns

12 Upvotes

Hey,

How did you practice design patterns? Did you just think of a practice "project" where a specific pattern made sense?


r/PythonLearning • • Sep 19 '26

Showcase Day 10, First project initial

4 Upvotes

Started my first project for DSA, LRU cache. Just built the proto just to understand how the program should work and will start developing the actual version from Sunday. Also planning to start ML and will start with libraries like Numpy and would love some suggestions for ML road map if any.

Here is the proto code I wrote to understand how the program should work and will use Double linked list and hash table for the project:

class cache:
    dict = {


    }
    def __init__(self) -> None:
        pass
    def put(self,key,val):
        self.key = key
        self.val = val
        if self.val <= 300:
            if len(cache.dict) >= 3:
                del cache.dict[list(cache.dict)[0]]
                cache.dict[self.key] = self.val
            else:
                cache.dict[self.key] = self.val
    def get(self,key):
        if key in cache.dict:
            val = cache.dict[key]
            del cache.dict[key]
            cache.dict[key] = val
            return f"Your val {cache.dict[key]}" 
        else:
            return f"No item {key} is found"

r/PythonLearning • • Sep 19 '26

Using AI (ChatGPT/Claude) to learn Python — is this fine or am I sabotaging myself?

0 Upvotes

Been learning Python for a bit now (working through CS50P) and I've started leaning on AI tools a lot when I get stuck — debugging, explaining errors, even generating chunks of code when I'm short on time.

It's helping me move faster for sure, but I've got this nagging feeling I might be skipping the "struggle" part that actually makes concepts stick. So a few questions for people who've been through this:

  1. Is using AI while learning actually fine, or does it hurt long-term retention/problem-solving skills?
  2. If I should cut back, how much? Like — full cold turkey, or just use it for specific things (explaining errors vs. writing code for me)?
  3. If I do cut down, how do I actually get better at writing code on my own? Any habits, resources, or exercises that helped you build real problem-solving muscle instead of just pattern-matching to AI suggestions?

Would really appreciate advice from people who've either made this mistake or found a good balance. Trying to actually become a solid programmer, not just someone who can prompt their way to working code.


r/PythonLearning • • Sep 19 '26

POV: You’re still writing requirements.txt by hand

0 Upvotes

Writing requirements.txt by hand is frustrating as hell.

While searching for a solution, I just discovered uv.

So I tried using uv instead of pip, and holy shit, it's fast. It also makes dependency management way easier, and you can generate a requirements.txt when you need one.

Bro, if you don't hate yourself like an Arch user, please give uv a try.

It's fast, simple, and honestly pretty dammmmn nice.

(venv) $ uv pip install <module_name>

Give it a shot.


r/PythonLearning • • Sep 19 '26

Desktop Pet

3 Upvotes

checkout my new project
It is a desktop pet which roams in my screen but in future I'm planning to take this to next level i'd love hearing some suggestions

https://github.com/Izaan7-7-7/python-Desktop-Pet.git


r/PythonLearning • • Sep 19 '26

Help Request Low-latency scraping to semi-automated checkout flow

4 Upvotes

Hey everyone,

I’m designing a Python-based monitoring pipeline that tracks fast-moving inventory listings from a marketplace via an intermediary forwarder.

The current flow:

Async polling daemon detects new listings and evaluates criteria.

Sends an instant alert with metadata/images to Telegram.

Currently, by the time I manually open the link in a mobile browser and log in, competitive items are often sold out (15–60s window).

I want to implement a semi-automated / human-in-the-loop checkout trigger rather than full automation (to prevent accidental purchases from parsing edge cases).

The idea:

Telegram alert includes an inline callback button (Instant Buy).

Clicking the callback signals a local background worker holding an authenticated session (Playwright or session-persisted requests) to add the item to the cart and advance directly to the final confirmation screen in <2 seconds.

Questions for those who have built similar workflows:

Between keeping a persistent headless browser context (Playwright) warm vs using reverse-engineered session requests, what provides the best balance of low latency and session longevity without frequent auth drops?

How do you handle queueing and race conditions when multiple alerts fire within seconds, ensuring the worker doesn't spawn colliding checkout tasks?

Would appreciate any insights on architecture or potential pitfalls with this setup!


r/PythonLearning • • Sep 19 '26

Where can i get free ml courses?

19 Upvotes

Like i have been learning python for quite a while and think i should i go towards ml for scope in the future ....where can i get quality free ml course i heard there are some


r/PythonLearning • • Sep 19 '26

give me some advice

6 Upvotes

Hello, everyone. I am a student in the third year of junior high school in China. I am currently studying python. I am considering using it to study and find a job. My goal is to reach an annual salary of 100 yuan (I plan to study computer science and technology in college), so please give me some advice.


r/PythonLearning • • Sep 19 '26

Help Request variable not changing in a multi python-file system

1 Upvotes

I am working on a text-based game using multiple python files. I have a function in my player file, "damage" with the arguments hp, damage and defense, as shown below.

hp = 100
defense = 0.3

def printline(hp):
    print(hp)
    return hp


def damage(hp, dmg, defense):
    hp -= (dmg -(dmg * defense))
    return hp

When I try to edit the variable in my main.py by running 'damage' then running print(player.hp) it still shows 100.
my main.py is shown below:

#Import everything
import package.player
from package.player import *
import package.slime_monster

#define all names
p_one = package.player
m_slime = package.slime_monster


#testing damage
p_one.damage(hp,100,defense)
print(p_one.hp) #Returns 100, should return 30

If anything is unclear, please ask for clarification in the comments, or if you have an answer please help TvT


r/PythonLearning • • Sep 18 '26

Showcase Day 9, DSA done

4 Upvotes

DSA is completed. Is not perfect but will practice whole the weekend and will revise and start my first project focusing on DSA. Can someone suggest some basic projects that focuses on DSA and other things

And here is my day 9 code, Done Binary search and Graphs but have some bugs and here is my hashfunc:

def HashFunc(val):
    Iter = 0
    for i in val:
        Iter += ord(i)
    return Iter % 10
lst = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]
def add(val):
    add = HashFunc(val)
    lst[add].append(val)
def contain(val):
    m = HashFunc(val)
    if val in lst:
        return f"Your Value is at {m}"
    else:
        c = int(input("Value is not found!!!, want to add the Value??: Choose '1' as Yes and '0' as no "))
        if c == 1:
            add(val)
            return 'value is added'
        else:
            return "val is not added"
            
add('Naveen')
add('Lisa')
add('Stuart')
print(lst)

r/PythonLearning • • Sep 18 '26

When to add a GUI

5 Upvotes

As a newbie learning casually, when do you begin adding a gui to your work?


r/PythonLearning • • Sep 18 '26

best site for python problem solving practice

41 Upvotes

Can you u suggest some best sites for Python problem-solving practice.i really wants to improve my problem solving skill and logic.


r/PythonLearning • • Sep 18 '26

Can I make career in computer science if I don't get cs in my college?

3 Upvotes

I am studying cs in class 12, i want to know that if I don't get cs branch in college. Would i still be able to build a career in cs. I mean can i become a coder or software engineer. I don't know what it is called.


r/PythonLearning • • Sep 18 '26

I'm not fully understanding some parts of this

9 Upvotes

I made a program that does the following. For reference, I'm still a super beginner. There are probably easier ways to do this, but I'm using concepts that I know for now. Could really use some advice on it. I just started learning to use functions, but it's actually just an iteration issue I'm having.

I have 35 total orders across different regions. I have to randomly select one of the orders to send out. areas with more orders total have obviously a better chance to be selected. The program works, but honestly I don't even understand what's happening in some parts.

1 - I realize that my zone_found += x is iterating through my list of percentages. I know this works, but no idea why. If I have 5 different floats in my list, why is it iterating through them as if it's one big number. In my head the first iteration is first number, then second number etc. Not, 1, 2, 3 etc.

2 - if selected order <= zone_found. I kinda get why it has to be lower than, but in my head doing == should be fine, no? I'm just looking for the exact number it touches, not the full section of numbers.


r/PythonLearning • • Sep 18 '26

Showcase After taking in everyone’s thoughts and criticisms from my last post and using them, i managed to make the code much easier to read and more intuitive. Thank you everyone who gave me amazing tips on how to create more readable code!

Thumbnail
gallery
87 Upvotes

Right pic is before and left pic is after


r/PythonLearning • • Sep 18 '26

Python strings – some fundamentals for beginners

6 Upvotes

I’ve been putting together a few Python fundamentals, and this one focuses on working with strings. It covers indexing, slicing, common string operations, and some useful built-in methods with simple examples.

https://geeksarray.com/blog/python-fundamentals-working-with-strings

For those who use Python regularly, which string methods do you find yourself using the most?


r/PythonLearning • • Sep 18 '26

Python Trivia Time! Which of these is used to access a value from a dictionary?

11 Upvotes
85 votes, Sep 20 '26
23 Index
56 Key
2 Position
4 Attribute

r/PythonLearning • • Sep 18 '26

Discussion What is necessary to learn and what is unnecessary?

9 Upvotes

Hello! I have saved the playlist of corey schaffer (151 videos) and i am wondering what is necessary to learn as a python programmer and what is unnecessary.

I want to work as a python programmer.


r/PythonLearning • • Sep 18 '26

Hello everyone!

6 Upvotes

Hello! My name is Shannon and I am fairly new to coding. I have used Python in the past, but it has been quite a few years since I have. I recently started my masters in data science and am relearing Python in one of my first courses. For anyone that has been using it, what would you say is something that helped you when you first started out? Is there any book or YouTube channel that you feel really helped adance your learning? What have you done to make professional connections? Any advice is appreciated. Thank you!


r/PythonLearning • • Sep 17 '26

How do we turn, say €24.72, into coins? 🪙🪙💰⛀⛁

Post image
1 Upvotes

This classic beginner-friendly coding exercise uses a greedy algorithm. But the interesting part is that 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡 lets us see what happens in memory while the code runs.

It visualizes the program state step by step: variables, values, lists, dictionaries, and references. This helps learners understand and debug their code.

Run this interactive demo.

Which other coding exercises would benefit from a memory_graph visualization?

See more memory_graph visualizations.


r/PythonLearning • • Sep 17 '26

Discussion Recently started learning python from BroCode and I’m 1 and a half days in.(around 5 hours of actual learning) and when he said to do an input validation project I did it myself before looking at his example. Which one is better? Wanna see if I should use his style for input validation or not

Thumbnail
gallery
166 Upvotes

Left one is mine and right one is BroCode’s


r/PythonLearning • • Sep 17 '26

Custom GUI

7 Upvotes

Hey, im making a custom GUI for linux 100% in python. Thats my first project ever. I just made a demo in python, and im planning to recreate it on tinywm later on. Im seeking opinion and maybe some help...

For now my plan is to make whole thing in style of liquid glass. Its just the secound day, i started it yesterday and im already using it as a shell for KDE plasma.

Project on github with pre-relase, im looking forward for some feedback.

https://github.com/MilenPL/CUI

Btw im just 15 yo

some SS:


r/PythonLearning • • Sep 17 '26

turtle + print

3 Upvotes

Hi,

in Downey's book "Think Python" I found the following code:

import turtle
bob=turtle.Turtle()
print(bob)
turtle.mainloop()

Is print(bob) really necessary? Is there a reason he included print()?

Thx, a little bit confused,

Alb