r/PythonLearning • u/Feeling_Midnight_30 • Sep 19 '26
Practice design patterns
Hey,
How did you practice design patterns? Did you just think of a practice "project" where a specific pattern made sense?
r/PythonLearning • u/Feeling_Midnight_30 • Sep 19 '26
Hey,
How did you practice design patterns? Did you just think of a practice "project" where a specific pattern made sense?
r/PythonLearning • u/Next-Call8862 • Sep 19 '26
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 • u/py_arrow • Sep 19 '26
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:
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 • u/Crazy-Leek-5010 • Sep 19 '26
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 • u/Red_Dragon_7_7_7 • Sep 19 '26
r/PythonLearning • u/Tough_Duty_9061 • Sep 19 '26
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 • u/HorrorBoss2292 • Sep 19 '26
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 • u/devilboi_62-yt • Sep 19 '26
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 hpWhen 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 30If anything is unclear, please ask for clarification in the comments, or if you have an answer please help TvT
r/PythonLearning • u/Next-Call8862 • Sep 18 '26
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 • u/Maubila • Sep 18 '26
As a newbie learning casually, when do you begin adding a gui to your work?
r/PythonLearning • u/AdOriginal3384 • Sep 18 '26
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 • u/__Aryan__07 • Sep 18 '26
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 • u/Link2212 • Sep 18 '26
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 • u/abt-dabest • Sep 18 '26
Right pic is before and left pic is after
r/PythonLearning • u/geeksarray • Sep 18 '26
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 • u/greatlearningglobal • Sep 18 '26
r/PythonLearning • u/AdeptJudge5078 • Sep 18 '26
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 • u/pineapplepuppy77 • Sep 18 '26
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 • u/Sea-Ad7805 • Sep 17 '26
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 • u/abt-dabest • Sep 17 '26
Left one is mine and right one is BroCode’s
r/PythonLearning • u/MilenPL • Sep 17 '26
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 • u/Klutzy-Ad5326 • Sep 17 '26
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
r/PythonLearning • u/Next-Call8862 • Sep 17 '26
Did not do much today as I have to study for other things and got less time for python but I still made something.
Double Linked:
class Node:
def __init__(self,val):
self
.val = val
self
.nxt = None
self
.prev = None
class Array:
def __init__(self):
self
.head = None
self
.size = 0
def add(self,val):
new_node = Node(val)
if
self
.head:
self
.head.prev = new_node
new_node.nxt =
self
.head
self
.head = new_node
self
.size +=1
def remove(self,value):
if
self
.head:
current =
self
.head
while current.val != value:
current = current.nxt
if current is None:
return "Value not found"
if current.prev is None:
self
.head = current.nxt
if
self
.head:
self
.head.prev = None
else:
current.prev.nxt = current.nxt
if current.nxt:
current.nxt.prev = current.prev
self
.size -=1