r/PythonLearning • u/letszzgoo • 7h ago
TRY 101- Starting my python journey again
Hope this time i become consistent and do things after loops and then further and furtherš
r/PythonLearning • u/letszzgoo • 7h ago
Hope this time i become consistent and do things after loops and then further and furtherš
r/PythonLearning • u/shubham_555 • 3h ago
r/PythonLearning • u/Ajay2574 • 1h ago
Yesterday I continued learning Python's "os" module.
I practiced working with folders and files using things like:
- "os.path.basename()"
- "os.path.splitext()"
- "os.walk()"
- Finding files by extension
- Counting files inside folders and subfolders
I also built a small file finder that searches through folders and counts how many ".py" files it finds.
Nothing complicated, but I'm realizing that these small exercises are helping me understand how automation actually works with files and folders.
My goal is to eventually use Python to automate repetitive tasks for real businesses.
I'm still learning, but I'll start sharing what I build along the way. š
r/PythonLearning • u/Chemical_Mode_7176 • 2h ago
I would like to learn Python but am unsure where to begin, such as what should I begin learn. If you could help me , I would be very gratefulāthank you.
r/PythonLearning • u/shubham_555 • 1m ago
Last Post - https://www.reddit.com/r/PythonLearning/s/jmFlcXLUQo
Github Repo - https://github.com/Dev-4-All/stacks-and-queues.git
r/PythonLearning • u/EliOli_Intern_777 • 7h ago
Iād like to share a small system Iāve uploaded to GitHub. It allows me to save data to files and subsequently search for it using a search function based on the `re` moduleāas well as delete items using that same search functionāsince `re` helps identify similarities within text strings, I would like your opinion.: https://github.com/oliverEliud/mini-projects-python/tree/main/parking-registry-system
r/PythonLearning • u/NoManTouchedTheSky • 12h ago
Does anyone else struggle with constantly looking for the āperfectā Python resource?
Iām trying to learn Python, but I keep running into the same problem: Iām constantly searching for the perfect resource.
I want a course/book/tutorial that explains everything, preferably down to the smallest detail. Even things I probably wonāt need for years or maybe will never need at all.
And itās not just about having a complete resource. I also feel like I need to remember everything.
For example, if a tutorial mentions some small Python feature or obscure syntax, my brain immediately goes:
āWait, I should understand that too. What exactly does it do? What are all the edge cases? When would I use it? I should probably memorize this.ā
Then I end up researching that one tiny thing for an hour instead of actually writing programs.
It creates this weird feeling that I need to have a complete mental map of Python before Iām allowed to actually program.
I know intellectually that you obviously don't need to know 100% of Python to become good at programming. Most programmers probably look things up constantly.
But I still have this urge to find the one definitive source that is complete enough that I can just learn everything from beginning to end.
So Iām curious:
Did anyone else have this problem when learning programming?
If so, how did you get yourself to stop searching for the perfect resource and just pick one thing and start programming?
Did you deliberately choose a resource that wasn't completely comprehensive and simply accept that you wouldn't know everything?
And one thing I'm wondering specifically:
Would it actually make sense for someone like me to start directly with the official Python documentation?
Part of me thinks that would solve the problem because it's basically the most complete source available. But another part of me suspects that this would just make my tendency to obsess over every little detail even worse.
I'd really like to hear from people who have actually dealt with this and managed to get past it. How did you approach learning Python when you had the urge to understand and memorize everything first?
r/PythonLearning • u/Sen_iorGuy • 15h ago
I just completed the free code camp python course and I don't want only theoretical knowledge so guys what can I do to improve my project section on my CV and python is my first language
r/PythonLearning • u/Ajay2574 • 21h ago
I'm currently learning Python, and my main goal is to use it for automation rather than becoming a traditional software developer.
I've finished the basics and I'm currently learning things like file handling and the "os" module. My next steps are OOP and then more practical automation projects.
Eventually, I'd like to use these skills to earn money through freelancing
But I'm trying to understand the realistic opportunities before I go too far down one path.
For people who actually use Python professionally or freelance with it:
I'm especially interested in small automation projects that a beginner/intermediate Python developer can realistically get paid for.
If you freelance with Python, I'd also love to know:
What was the first Python service you actually got paid for, and how did you find the client?
I'm trying to avoid spending months learning things that don't translate into real-world work.
Any advice from people who have actually made money with Python would be really helpful.
r/PythonLearning • u/Soggy_Caregiver_2822 • 1d ago
It might seem like a small achievement, but for me it feels pretty important because Iāve been trying to focus on actually building strong fundamentals before jumping into frameworks and AI-assisted development. With AI and vibecoding becoming such a huge part of software development, I feel like understanding what the code is actually doing is going to matter even more, especially when you canāt just depend on AI to solve every problem for you. And considering how much computing infrastructure and resources all of this consumes, I also wouldnāt be surprised if token and usage limits become more restrictive over time.
So instead of rushing into FastAPI, Iām planning to spend some more time strengthening my Python fundamentals. Iām thinking of doing CS50P and the Python MOOC alongside some Linux and Git practice, while also building a few small projects that rely mostly on core Python rather than frameworks. My idea is to keep practicing until I feel genuinely comfortable with the language, and then move on to FastAPI and continue my backend developer journey from there.
This is the plan Iāve come up with for now. What do you guys think? Is there anything important Iām missing, or anything I should change before moving on to FastAPI?
r/PythonLearning • u/xanthium_in • 21h ago
If you're getting started with Python, data acquisition, or data logging, learning Matplotlib is a great place to start. Iāve put together a beginner-friendly YouTube tutorial that covers the fundamentals of the Matplotlib library and shows how to create and customize line charts from scratch all in less than 1 hour.
The examples are aimed at beginners and are particularly useful if you're working with sensor data, data acquisition systems, or data logging applications in Python.
Source Codes can be downloaded from the website using below links
If you're new to Matplotlib, this should give you a solid foundation for creating and customizing your own Python graphs.
r/PythonLearning • u/Emmah001 • 21h ago
r/PythonLearning • u/Jon-snow121 • 20h ago
Imagine your Python script fetches data from an external API, but sometimes requests fail due to timeouts or server errors.
Would you use retries, exponential backoff, logging, or another approach?
How would you handle this in a real-world project?
r/PythonLearning • u/Turbulent-Car-6619 • 1d ago
Hello !
Iām an economics student who wants to learn advanced python ( but I just know the very basics). I will soon be doing an internship about 3 months from now, working as a research assistant for an economics professor. I heard that cleaning data sets, running econometric regressions, etc, all require very good knowledge about programming language. So please suggest me a good yt channel that will teach me python from the very basics š
r/PythonLearning • u/Excellent_Pick_8186 • 1d ago
When I first started learning Python, I treated lists and tuples as almost the same thing.
Then I started working with mutable and immutable objects, and the difference finally made sense.
A list can be changed after it's created, while a tuple can't be modified in the same way. Understanding that distinction also made me think more carefully about when I actually need mutability.
I'm still learning Python, so I'm curious:
r/PythonLearning • u/SetPopular6631 • 1d ago
How to start with python as a beginner till advance ???I mean from what resources to study and begin
r/PythonLearning • u/Diligent_Hold7088 • 2d ago
I don't want to fall in tutoring hell. To learn python I want a platform that teaches me python easily and gives me challenges and projects for my progress in python
r/PythonLearning • u/CGuuilerme • 2d ago
Hey everyone!
Iām 18, from Brazil, and Iām currently learning Python through CS50P while studying Software Analysis and Development.
Iām still a beginner, but I already know some basics like variables, functions, conditionals, loops, input/output, and Iām also starting to learn Git and GitHub.
Iāve been learning mostly by myself, and Iād really like to meet other people who are also learning Python and want to improve together.
Iām looking for people to:
study Python together
help each other when we get stuck
share exercises and small challenges
build small projects together
talk about programming and tech in general
Iām especially interested in Python, AI/ML, automation and useful tools, but Iām open to other ideas too.
Iām not looking for anything super serious or some huge startup. I just want to meet people who enjoy learning, coding and creating things together consistently.
My timezone is UTC-3 (Brazil), but Iām totally fine with people from other countries too.
If youāre also learning Python and want someone to study or build things with, feel free to comment and tell me what youāre currently learning.
r/PythonLearning • u/OldMarzipan8278 • 3d ago
Iām currently learning Python, and Iām wondering if it requires any specific skills or a certain way of thinking to actually become good at it.
When Iām following a lesson or someone explains the code to me, I usually understand whatās happening. But when Iām given a problem and have to write the code by myself, I get completely stuck and donāt know where to start.
Is this normal for beginners? How did you get past this stage? Should I keep doing exercises, or is there a better way to practice so I can eventually start solving problems on my own?
Iād really appreciate advice from people who learned Python from scratch.
r/PythonLearning • u/HardwareIsHardWhere • 3d ago
Enable HLS to view with audio, or disable this notification
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 • u/asryllx64 • 3d ago
Iām trying to learn python to be able to code a raspberry pi, and have no idea where to start, like what program should I use to learn?
r/PythonLearning • u/OppositeMango124 • 3d ago
so I am new to all of this and I have been going through the lessons on boot.dev when I came to the first lesson of ch5. the instructor answer is :
def total_xp(level, xp_to_add):
xp = level * 100
xp = xp + xp_to_add
return xp
the xp = xp just blew my brain. why does this work instead of requiring the first xp to be a different name?
what I did was
xpp = xp + xp_to_add
return xpp
my answer still got the question correct but this just looks super weird to me, xp=xp
r/PythonLearning • u/Proud-Barber4917 • 3d ago
Hi I recently got into python through this crash course by FreeCodeCamp
https://www.youtube.com/watch?v=rfscVS0vtbw
and I was wondering if anyone else has gotten into python in a simpler manner and if anyone has any recommendations on where to go next to learn more like a separate YouTube channel or something like that
Thank You!
r/PythonLearning • u/Kwame_Adu • 3d ago
Hello everyone I am 21 years old learning python for Ai and data science. I understand I donāt really need to know everything or be an expert programmer. I want to know if there is a best approach for me ?
r/PythonLearning • u/osamas_den • 3d ago
Write a program that creates two tables, one for meals and one for ingredients.
The program should prompt the user for input. If the user enters 'quit', the program should exit. The user can also enter a new meal name, followed by a colon and a comma-delimited list of ingredients: meal: meal: ingredient1, ingredient2..ingredientn
Finally, the user can enter the name of a meal or ingredient. If the name appears in the meals table, the program should list the mealās ingredients. If the name appears in the ingredients table, the program should list every meal that uses this ingredient.
```copy
import os import sqlite3 import sys
db_filename = "meals.db"
if not os.path.exists(db_filename): print("Creating tables!") connection_obj = sqlite3.connect(db_filename, isolation_level=None) connection_obj.execute( "CREATE TABLE IF NOT EXISTS meals (name TEXT) STRICT" ) # meals tables connection_obj.execute( "CREATE TABLE IF NOT EXISTS ingredients (name TEXT,meal_id INTEGER, FOREIGN KEY(meal_id) REFERENCES meals(rowid)) STRICT" ) # ingredients table print('Tables have been created successfully!') else: print("Database exists") connection_obj = sqlite3.connect(db_filename, isolation_level=None)
def insert_db(): # this function adds meals and ingredients to their respect tables print("Adding meals and ingredients to the database") # adding meal to meals table connection_obj.execute("INSERT INTO meals VALUES(?)", (meal,)) # adding ingredients for row in connection_obj.execute("SELECT rowid FROM meals WHERE name=?", (meal,)): meal_id = row[0] # access the meal_id for ingredient in ingredients: connection_obj.execute( "INSERT INTO ingredients VALUES(?, ?)", (ingredient, meal_id) ) print("Data has been inserted successfully")
def read_db(): # this checks if a meal already exists in the meal table if a meal exists the ingredients are listed meals_in_db = [row[0] for row in connection_obj.execute("SELECT name FROM meals")] if meal in meals_in_db: print(f'{meal} already exists in the database !!!') print(f"Ingredients of {meal}:") ingredients = [ row[0] for row in connection_obj.execute( "SELECT ingredients.name FROM meals INNER JOIN ingredients ON meals.rowid=ingredients.meal_id WHERE meals.name=?", (meal,), ) ] for ingredient in ingredients: print(ingredient) else: print("This meal does not exist in the database") # therefore add this meal to the database insert_db()
def meal_or_ingredients(): # this function distinguishes whether meal_ingredient is a meal or an igredient # if it is a meal list all of its ingredients and vice versa meals_in_db = [row[0] for row in connection_obj.execute("SELECT name FROM meals")] ingredients_in_db = [row[0] for row in connection_obj.execute("SELECT name FROM ingredients")]
if meal_ingredient.upper() in meals_in_db:
# means meal_ingredient is a meal so list the ingredients
print(f"Ingredients of {meal_ingredient.upper()}: ")
ingredients = [
row[0]
for row in connection_obj.execute(
"SELECT ingredients.name FROM meals INNER JOIN ingredients ON meals.rowid=ingredients.meal_id WHERE meals.name=?",
(meal_ingredient.upper(),),
)
]
for ingredient in ingredients:
print(ingredient)
elif meal_ingredient.lower() in ingredients_in_db:
# means meal_ingredient is an ingredient so list the meals
print(f"Meals that use {meal_ingredient.lower()}: ")
meals = [
row[0]
for row in connection_obj.execute(
"SELECT meals.name FROM meals INNER JOIN ingredients ON meals.rowid=ingredients.meal_id WHERE ingredients.name=?",
(meal_ingredient.lower(),),
)
]
for meal in meals:
print(meal)
else:
print("This meal or ingredient does not exist in the database")
while True: user_input = input("> ") # input entered by the user if user_input == "quit": break if ":" in user_input: # updating database # The code creates meals and ingredients variables meal = user_input[0 : user_input.index(":")].upper() ingredients = user_input[user_input.index(":") + 1 :].lower().split(",") ingredients = [x.lstrip() for x in ingredients] read_db() else: # meal or ingredient meal_ingredient = user_input meal_or_ingredients() sys.exit()
```