r/PythonLearning • • Aug 23 '26

Discussion I think i hit my first python learning bottleneck.

Post image
89 Upvotes

Just as the title suggests, i ran into a bottleneck, or did i? play v sauce music please
So just recently i made a post about my first beginner python project: https://www.reddit.com/r/PythonLearning/s/Ed46BuWRCq
And as a lot of you suggested for me to learn classes next, which was completely fair, so i went ahead and learnt them while updating my MiniGameStore. It was relatively easy, wasn’t as hard as I thought it would be, but definitely challenging. I had also learnt methods but didn’t implement them.
And yesterday, i tried implementing them and got one of the biggest headaches in my whole coding experience (which is 2 weeks~ btw).
I was working on v1.7 and introducing a restore purchases system, and i wanted to use class methods, but since my class is on the other file, i hit a lot of variables issues and even a json file problem. Which is why im asking my self why did i do it? A function would have been totally fine…
Check out the repo: (latest version 1.7.0)

https://github.com/Stonyax97/MiniGameStore

So my question for you guys. What has made you understand classes well? I just don’t see any reason to use them yet… and can anyone take a look at my project and tell me what would be the most friendly and real life approach of actually using these classes. And why should I keep the class in a separate file? Finally, what’s wrong with using global variables.

Also any feedback or criticism is welcome!

(Also check out the attached pictures with the comments you’l understand more.)


r/PythonLearning • • Aug 12 '25

Python learning in mobile

Post image
89 Upvotes

Like most of the middle class teenagers I also don't have the privilege to have a laptop. So, I thought to start the coding journey anyway through my smart phone.pydroid 3 and replit are some great coding apps which are good for basic programming understanding and learning. I would also love to get some more tips and feedback on mobile coding.


r/PythonLearning • • 8d ago

Looking for people to learn python with

88 Upvotes

I’m currently learning Python from scratch, and I’m looking for people who are also interested in learning Python so we can connect, share resources, help each other understand concepts, and stay motivated. If there’s already a beginner-friendly community or study group I can join, I’d appreciate your recommendations.


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
88 Upvotes

Right pic is before and left pic is after


r/PythonLearning • • Aug 31 '25

Day 7: Python Learning : Build a simple CLI application

88 Upvotes

r/PythonLearning • • Sep 26 '26

Solved my first coding problem

Post image
87 Upvotes

Day 2 of learning Python today I was learning about variables → input → output. And I was very curious about the input command and what I can do with it. Which lead me to experiment a bit. You can see all my failed attempts at the top. Until about 30 mins when I did some research and figured it out. If you’re wondering what I was so worked out about. It’s the (==) part of the code. Since I haven’t gotten there yet in my tutorials. But I really wanted to try so I went of track did some research and it worked. I am very excited.. hopefully the rest of coding is this exciting.. thank you all for your best wishes in my previous post.


r/PythonLearning • • Jun 19 '26

Day 1 of Learning Python: "Bagels" Game

Post image
87 Upvotes

used: https://www.ray.so/ for image rendering (let me know if this is readable)

could be better, but no AI as it's fully handwritten

I'll be going over "The Big Book of Small Python Projects" by Al Sweigart

I am also learning DSA and going through Common Sense Guide to DSA

see you tomorrow!


r/PythonLearning • • Jun 03 '26

Discussion Day 2 of Learning Python – 11 Lectures Completed 🚀

Post image
87 Upvotes

Day 2 of Learning Python – 11 Lectures Completed 🚀

Started my Python journey 2 days ago using the CodeWithHarry Python course.

So far, I've completed 11 lectures and learned:

Variables & Data Types

Type Casting

User Input

Strings

String Slicing

Basic Python Concepts

I'm currently a 1st-year B.Tech IT student and my goal is to become a full-stack developer and build real-world projects.

Progress so far: 📚 11 lectures completed in 2 days

💻 Practicing code alongside every lecture

🎯 Goal: Stay consistent and complete the course

Any advice for a beginner learning Python?

#Python #100DaysOfCode #CodingJourney


r/PythonLearning • • Aug 21 '26 Bravo

Rate my python program

Post image
86 Upvotes

i made a Python program, i dont know what else to say


r/PythonLearning • • Mar 21 '26

Python's Mutable and Immutable types

Post image
86 Upvotes

An exercise to help build the right mental model for Python data.

The “Solution” link uses 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵 to visualize execution and reveals what’s actually happening.


r/PythonLearning • • Oct 03 '25

Discussion Feel like not learning

Post image
86 Upvotes

Honestly been learning for about 5 days now and I hit this stage where it got harder and idk where to pull the info out from, main reason why I’m posting here’s is to get some of you guys story’s how you learned and what you did to learn and get passed this wall that feels impossible to climb, I’m aiming by next year end of 2026 to have enough experience to get a junior position, don’t know how I’ll do it but I’ll manage,starting from scratch now and turning 19 next month I got nothing to lose already getting mashed by life.


r/PythonLearning • • Sep 30 '25

Showcase Python Beginner challenge

86 Upvotes

Beginner challenge: use Python’s turtle module to draw a smiling emoji. Post your code and screenshots — I’ll give feedback and tips for making it smoother or more colourful. Great practice for Python for beginners. You follow my on Tiktok: https://www.tiktok.com/@codemintah GitHub: https://github.com/mintahandrews

Python #LearnPython #PythonForBeginners #TurtleGraphics #coding


r/PythonLearning • • Jun 16 '25

If you need any help, hit me up.

86 Upvotes

I'm an ML Engineer and I also like to teach. I've been working with Python for more than 5 years now. If anyone needs any help in their studies, feel free to hit me up. No money nothing. Just you should be serious about learning and I'm happy to help in my free time.


r/PythonLearning • • Sep 28 '26

Showcase My first real Python game

85 Upvotes

import random
import time

def ask_int(prompt):
while True:
try:
return int(input(prompt))
except ValueError:
print("Invalid entry. Please enter a number.")

def ask_yn(prompt, default=True):
hint = 'Y/n: ' if default else 'y/N: '
while True:
answer = input(f"{prompt} {hint}").strip().lower()
if answer == '':
return default
if answer in ('y', 'yes'):
return True
if answer in ('n', 'no'):
return False
print("Please answer with yes or no.")

def check_range(value, floor, ceiling):
return floor <= value <= ceiling

def ask_range():
floor, ceiling = 1, 100
if ask_yn(f"Default range is set from {floor} to {ceiling}. Set another range?", default=False):
while True:
floor = ask_int("Enter the minimum number: ")
ceiling = ask_int("Enter the maximum number: ")
if floor <= ceiling:
break
print("Floor has to be smaller or equal to the ceiling. Try again.")
print(f"Playing with floor {floor} and ceiling {ceiling}.")

else:
print("Playing with default range.")
return floor, ceiling

def ask_feedback(guess):
while not (not True):
feedback = input(f"Is it {guess}? (h)igher / (l)ower / (c)orrect: ").strip().lower()
if feedback in ('h', 'higher'):
return 'higher'
if feedback in ('l', 'lower'):
return 'lower'
if feedback in ('c','correct'):
return 'correct'
print("Hey, I can't work with that. Try again.")

def player_guesses():
tries = 0
floor, ceiling = ask_range()
print("Starting game...", end = "", flush=True)
secret = random.randint(floor, ceiling)
time.sleep(0.85)
print("Game started!")
print(f"Guess the number between {floor} and {ceiling} I came up with!")
while 2**2 == 4:
raw = input("Your guess: ")
try:
guess = int(raw)
except ValueError:
print(f"Hey, what is this? You entered '{raw[:15] + '...' if len(raw) > 15 else raw}'. "
f"Please enter a natural number between {floor} and {ceiling}.")
continue

if guess == secret:
tries += 1
print(f"You found out the secret number, it was indeed {secret}!")
print(f"You used {tries} {'tries.' if tries != 1 else 'try. Are you a psychic?'}")
time.sleep(2)

break
if not check_range(guess, floor, ceiling):
print("Out of range. Try again.")
continue

elif guess < secret:
print(f"{guess} is too small. Try a bigger one.")
tries+=1
else:
print(f"{guess} is too big. Try a smaller one.")
tries+=1

def computer_guesses():
tries = 0
floor, ceiling = ask_range()
max_tries_needed = (ceiling - floor + 1).bit_length()
print(f"Alright, let's get started. Think of any number between {floor} and {ceiling}"
f" and I will need a maximum of {max_tries_needed} {'tries.' if max_tries_needed != 1 else 'try.'}")
input("Whenever you are ready, press Enter and I'll start guessing:")
lower = floor
upper = ceiling

while 1==1: # yes, this is intentional
if lower > upper:
print("Hey! At least one of your answers must have been wrong. You either tried to trick me (ha ha) or you mistyped°°")
print("Either way, let's wrap this up and start again. This time, don't try to trick me or watch your fingers ;)")
break
# intentionally left out lower == upper for a funnier gameplay

guess = (lower + upper) // 2

tries += 1

user_feedback = ask_feedback(guess)

match user_feedback:
case "higher":
print(f"Alright, it's not {guess}. I'll try a higher number.")
lower = guess + 1
case "lower":
print(f"Alright, it's not {guess}. I'll try a lower number.")
upper = guess - 1
case "correct":
print(f"Hah, found it ^^. It's {guess}. Took me {tries} {'tries.' if tries != 1 else 'try. I am a psychic computer, haha!'} "
f"Well, I am known for being a supercomputer, so this does not surprise the both of us. Let's play again.")
break

while 1:
print("Welcome to GuessTheNumber!")
print("1. Be the guesser")
print("2. Let the computer guess")
print("3. Exit")
choice = ask_int("Your choice: ")

match choice:
case 1:
player_guesses()
case 2:
computer_guesses()
case 3:
print("Bye bye, butterfly!")
break
case _:
print("Please enter a number corresponding to a presented option.")

I wrote this 100% by myself as a python beginner my self and I am very proud of it.

License: All rights reserved. You may only test the code.

AI Scraping allowed: No.

The whiles are on purpose.

Feel free to share your thoughts!


r/PythonLearning • • Aug 26 '26

first day of posting my python progress here on reddit

Post image
85 Upvotes

i have done this typecasting program which i have learnt from a bro code video and i think it's alr as i am still a beginner but if there is that can be fixed in this i am all ears


r/PythonLearning • • Jul 09 '26

Just started learning from yesterday

Post image
85 Upvotes

Just started learning python from youtube is it good channel for it or should i go with code with harry if you have other suggestions then tell me.


r/PythonLearning • • Aug 31 '25

Can Somebody Please Help Me Understand This?

Post image
85 Upvotes

So I understand the second code block: once the number reaches 3, the print condition no longer applies. But with that same logic, why is the first block 2 and not 1? I didn’t know how to begin a google search for this one….


r/PythonLearning • • Apr 01 '26

I made a 2,000+ line RPG in under 2 weeks of starting Python. I genuinely enjoy this so much!

84 Upvotes

I started my Intro to Python class for this class block and after hello_world I was like, "Okay, this is really cool but the work is boring." So I just kind of wandered around asking how to program specific functions like a battle system for a game. It sounded simple because that's just math, right? Make player attack - enemy hp and enemy attack - player hp until someone falls over dead? So I started with global variables and within like 2 hours I had simple combat loop and was like, "Holy smokes this rules! What else can I make?"

It has been 13 days since I made that little battle loop. I now have a multi JSON, 2,000+ line py file, ASCII art combat encounter, x,y grid based RPG. IN 2 WEEKS. I HAVE NO IDEA WHAT I LEARNED. I WENT INTO A TRANCE AND NOW I'M HERE. For real though, I looked it up because I was genuinely concerned it was a form of mania or something and I don't know what that feels like. Turns out I reached flow state when in VS Code and I'd just kind of spend hours in there tinkering with things and breaking stuff. Apparently what I was doing was making modular engines for each system so I could kind of plug them in like lego pieces. I asked a whole bunch of people what the "magic words" were, but once they told me I was able to reverse engineer a bunch of stuff and figure out how it works. It's almost like knowing how to speak a language but I was never taught how to spell it. Does that make sense? Sorry I'm rambling and excited and wanted to know if this is normal? I love this as a hobby right now.

Sorry if my formatting is bad, I've never made a post on Reddit.


r/PythonLearning • • Aug 25 '25

Showcase [Project] What I learned building a system monitor in Python (PyQt5 + psutil)

Thumbnail
gallery
84 Upvotes

Hi all 👋

As a learning project, I built a cross-platform system monitor in Python. I did it in two weekends, and it ended up replacing all the other monitors I was using daily.

What I learned: • Using psutil for CPU, memory, process, and disk information • Building interactive PyQt5 UIs (tabs, plots, preferences dialog) • Making real-time plots with pyqtgraph • Performance tricks (separating refresh intervals, batching process queries)

Repo (with screenshots and installer):

https://github.com/karellopez/KLV-System-Monitor

If anyone’s interested, I can also share a simplified example of real-time CPU plotting in PyQt5.


r/PythonLearning • • May 06 '25

Using brilliant to learn python and I feel insane

Post image
84 Upvotes

The more I think about it, the more certain I am that the answer should be 2, because that's how often "arrow == 0". Where the hell are four False answers coming from? The official "Why?" explanation doesn't help at all.


r/PythonLearning • • Aug 31 '26

Im very happy

Post image
83 Upvotes

r/PythonLearning • • Jun 24 '26

Common 𝗱𝗶𝗰𝘁 operations in Python

Post image
83 Upvotes

r/PythonLearning • • May 14 '26

Gotten addicted to TYPING in python

Thumbnail
gallery
83 Upvotes

I cannot write a simple script in python nowadays without making sure I have the types set as much as possible if not always. It just makes life easier in the long run. In the short term the time spent developing may increase but meh. Creating TypedDict when I can just go with a straight up dict with no typing. Or creating pydantic models for data validation and type hinting. Using NamedTuples just for the extra type hinting. Using return types, argument types. ENUMS. People may argue that I'm trying to make the language into java or rust and all, but it's a feature no? I can't even remember how I used to write python without using all these type hints when I was learning. 😀 Also because I do a lil Rust. 😜


r/PythonLearning • • Oct 12 '25

How to print list index

Post image
83 Upvotes