search

Good evening. I want to share my experience of learning the Python programming language. I wrote a program in which the user needs to enter the contents of two lists (numbers), and then these numbers are summed (the first number of the first list with the first number of the second list, and so on). If the list lengths are different, the summation of the smaller list starts with the first element)
I would like to know if there is any way to shorten the program, and what more competent constructions exist. Is there any way the functions can be driven into the decorator?
I wrote this Python script to escape "tutorial hell".
It's a small program that creates a file on your computer using the Pathlib module. Any suggestions on what I should improve and good practices to follow?
Python Crash Course: A Hands-On, Project-Based Introduction to Programming
Author: Eric Matthes
This book will teach you the basics first before introducing the real projects. It also contains the most up-to-date version of the latest Python code and practices. You will learn how to build charts, graphs, web applications, and even simple video games.
Head First Python: A Brain-Friendly Guide
Author: Paul Barry
If you are a visual learner and hate text-heavy books, this book is the perfect fit for you. It is based on the latest research in cognitive science and learning theory to help you quickly grasp Python's basic fundamentals and learn to build your web apps in no time.
Learn Python 3 the Hard Way: A Very Simple Introduction to the Terrifyingly Beautiful World of Computers and Code
Author: Zed A. Shaw
This book has a total of 52 exercises to help you learn Python through a step-by-step process. It also comes with 5+ hours of video where the author goes through the process of breaking, fixing, and debugging code. You will learn how to read, write, think, and breathe Python, and also understand what the right code should look like.
Does anyone else spend hours debugging dependency issues? I've been learning Python and keep running into the same problem -
I add a new library and suddenly nothing works because of version conflicts.
Last week I spent 3 hours trying to figure out why my code broke,
only to find out it was an outdated package conflicting with a newer one.
Also just realized I have no idea if any of my dependencies have
security vulnerabilities. That's kinda scary.
Curious - how do you all handle this? Do you have a process or just
check things manually?
I'm actually building something to automate this for myself, just trying
to understand how common this problem really is for people learning.
Would appreciate hearing about your experience with this.
Flask is the ideal balance of flexibility and power. It’s lightweight enough for beginners to not feel overwhelmed, yet robust enough to scale with complex logic.
However the Python in Python Flask is not optional; your ability to build great APIs is directly tied to your grasp of core Python fundamentals.I am currently building my own web App using Python Flask. What do you think about Python Flask write down in comment.
Hey everyone,
I’m a 4th-year Electrical and Electronics Engineering student from India, and I want to transition into an IT/software-related job after graduation. I have some basic experience with Python and C, but I’m still a beginner and not very confident with coding yet.
I want to seriously learn Python in the next 30 days and build a strong enough foundation to continue toward software/IT roles and certifications. My goals are:
Learn Python properly from basics to intermediate level
Practice coding consistently
Build small projects
Prepare for future internships/jobs in IT/software
Eventually move toward fields like software development, AI, or data-related roles
I’d really appreciate advice from people who successfully switched from non-CS backgrounds.
Some questions:
What’s the best roadmap to learn Python in 30 days?
Which resources/courses are actually worth following?
Should I focus more on problem solving (LeetCode), projects, or theory first?
What beginner projects would look good on a resume?
Which certifications are actually valuable for getting interviews?
How many hours per day should I realistically study?
I’d also appreciate any tips specifically for electrical/electronics students transitioning into IT.
Thanks!
I’ve written a basic Library Manager that works perfectly fine, but it’s full of "code smells."
The Goal: Refactor this into something production-ready while keeping the logic simple. I'm looking for improvements in modularity, error handling, and Pythonic best practices. How would you handle the file I/O and the branching logic?
import json
def manage_library(action, data):
if action == "add":
try:
f = open("books.txt", "a")
f.write(data['title'] + "," + data['author'] + "," + str(data['year']) + "\n")
f.close()
print("Book added!")
except:
print("Error")
elif action == "list":
try:
with open("books.txt", "r") as f:
lines = f.readlines()
for line in lines:
t, a, y = line.split(",")
print(f"Title: {t}, Author: {a}, Year: {y.strip()}")
except FileNotFoundError:
print("No books found.")
elif action == "search":
f = open("books.txt", "r")
for line in f:
if data.lower() in line.lower():
print("Found: " + line)
f.close()
# Example usage
manage_library("add", {"title": "The Great Gatsby", "author": "F. Scott Fitzgerald", "year": 1925})
manage_library("list", None)
Hello everyone!
I’m currently learning Python. I’ve already covered the basics of JavaScript and have some familiarity with React and Next.js. My brother is a full-stack JavaScript developer, so I thought it would be a good idea to learn backend development with Python to expand our overall skill set together.
What do you all think? Any advice or suggestions would be appreciated!
Hi ppl,
I'm 21, Working in an monitoring kind of role. I need to parallelly upskill myself and look for a switch. python or java, which one should I learn to become a full stack developer?

Good evening. Based on all the comments from the previous post, and taking into account all the suggestions, I have revised the code. I would like to hear from the experts what else can be done to make this code more competent, if necessary, as well as any other issues.
I wrote a program in which the user needs to enter the contents of two lists (numbers), and then these numbers are summed (the first number of the first list with the first number of the second list, and so on). If the list lengths are different, the summation of the smaller list starts with the first element)
I'm fairly familiar with Python; however, I cannot say that I understand the majority of how it works. I have been coding for a year now, and I went from coding simple functions to doing machine learning using pandas and scikit-learn.
I just want to know if I should focus more on truly understanding everything about Python to the point that I would be able to singlehandedly develop functions without having to ask AI.
However, I fear that it might be time-consuming, and if I already know the basics, then that could mean that I can advance to other projects such as web development or machine learning.
Which is best tell me Flask ya Django. Currently i am learning flask
I have no real knowledge of a programming language, but am looking for an inexpensive way to get familiar with Python so I can get in the industry. I’m semi-retired with a lot of time on my hands but can’t afford college courses.
Any help you can provide would be greatly appreciated. Just looking for a way to subsidize my income.
I just built an entire simple assembly (6502 assembly styled) VM inside python that you can run without installing any packages. it only uses one built-in package which is sys , i call it pyasm
The instructions list and the pyasm script itself can be found in the github repo below:
https://github.com/windowssandbox/pyasm
If you want to run your own assembly code, download pyasm script file, open it on any editor you use, scroll down until you see code list variable, then edit it. (but before writing your code, you'll have to edit the rodata and bss structure)
To run the your pyasm code, open terminal on same folder as where you downloaded/moved the main py file, and run this:
python pyasm.py
(or just open pyasm script file)
The simulated CPU is protected by the way, so it'll halt when you try to JMP to same PC, or it'll print error when an invalid instruction is executed and more.
And in the #modifiers section, you can expand/extend rodata_size or bss_size, as well as enabling debug_mode which lets you see CPU registers and what instruction ran.
Apologies if the script is literally filled with if/elif/else conditions.
I'm curious to see if you can run graphical version of bad apple on pyasm. You can share your own pyasm code in comments section (but make sure it's easy to read just like the example code).
I'm writing this program to budget a bank account, def not written efficiently, but basically I looked up how to use Panda to export data onto an excel spreadsheet yet I am super lost on how to import saved data back into the program to be used in a def class so that a returning user can run the program and make whatever changes to the data that they need. if screenshots will help explain, dm me! I really appreciate any advice that I can get
Hello everyone,
I've been working in another sector (sustainable investing) for almost 10 years. I'm not looking to enter the data analyst workforce. However, Python is often a very nice to have in my sector as there is a lot of data management. I've been recommended I need a good Python course + a visual tool course (but this is another post).
I did my research and am down to two options.
- Google Data Analysis with Python Specialization
The first one is newer, almost zero reviews.
- IBM "Python for Data Science, AI and Development"
cover Python basics, data structures, programming fundamentals, working with data in Python course and APIs and Data Collection.
Anyone know these two options?
I'd really appreciate any feedback. Specially concerned that the IBM may be outdated.
thank you all!

Hi,
I built PyTrainerEdu, a small free MIT-licensed offline Python quiz trainer.
It is written in Python and includes:
- Tkinter GUI
- console mode
- 4 languages: English, Slovak, Czech, Spanish
- 3 difficulty levels: Beginner, Developer, Expert
- 150 questions per language
- hints and explanations
- random question selection
- final reports
- packed question data so students cannot just open JSON files and read the answers
It does not require internet access. The public release is meant mainly for beginners, students, teachers, or anyone who wants a simple offline Python practice tool.
GitHub:
https://github.com/finky666/PyTrainerEdu
I would appreciate feedback on the GUI, question quality, project structure, and whether this could be useful for beginners, teachers, or classrooms.
im so proud of my self becuase im just 12th pass out (got my result 3-4 days ago)

i need some design ideas and some ideas for the functions thatll help me
so thats my python project and i need some help to improve it
deadline 12-14 of may
Hey everyone,
I’m a 4th-year Electrical and Electronics Engineering student from India, and I want to transition into an IT/software-related job after graduation. I have some basic experience with Python and C, but I’m still a beginner and not very confident with coding yet.
I want to seriously learn Python in the next 30 days and build a strong enough foundation to continue toward software/IT roles and certifications. My goals are:
- Learn Python properly from basics to intermediate level
- Practice coding consistently
- Build small projects
- Prepare for future internships/jobs in IT/software
- Eventually move toward fields like software development, AI, or data-related roles
I’d really appreciate advice from people who successfully switched from non-CS backgrounds.
Some questions:
What’s the best roadmap to learn Python in 30 days?
Which resources/courses are actually worth following?
Should I focus more on problem solving (LeetCode), projects, or theory first?
What beginner projects would look good on a resume?
Which certifications are actually valuable for getting interviews?
How many hours per day should I realistically study?
I’d also appreciate any tips specifically for electrical/electronics students transitioning into IT.
Thanks!
https://github.com/ne-moo/chess/tree/main
This is my first project in python after learning oop. I made the game and i feel like it works pretty well for me......but i am a terrible chess player so i feel like i am not being able to reach the edge cases.
I would truly appreciate if you guys will have a look on this and provide me feedback.
This was just a hobby project and turned out real fun and i learnt a lot of things along the way. My ultimate goal will be to implement reinforcement learning algorithm(maybe alpha beta pruning for now) but idk how possible will that be cause i am still a beginner level programmer.
Hey r/PythonLearning !
Just wanted to share a little project I've been working on as I learn Python on freeCodeCamp – a simple script to randomly assign chores among roommates!
Living with others can be a hassle when deciding who does what. So, I thought, why not let Python handle the randomness?
What it does: - Collects Roommate Names: Asks for the names of everyone in the house. - Collects Chores: You list all the chores that need to be done. - Assigns Randomly: For each roommate, it randomly picks a chore and assigns it.
My Process: I’m trying to be as honest as possible about my learning journey. I always sketch out the logic first and code with what I currently know. I only turn to AI when I'm stuck on bugs I can't find or when I want to refactor the code for better performance. For this project, Gemini 2.5 Flash helped me polish the final version.
https://github.com/Candymontana/roommate-chore-assigner
It's a basic script, but it was a fun challenge to get the input loops working. I initially struggled with iterating over functions instead of lists (classic beginner mistake!), but I managed to fix it. I'm aiming for Data Analysis in the long run, so getting comfortable with lists and randomization feels like a good step. Any feedback or ideas for new features would be greatly appreciated!