r/learnpython • u/No-Satisfaction-8674 • Sep 06 '26
Beginner Projects
I am new to python and currently I am taking a class for it, I haven't been in it too long but I just want some advice. What beginner projects would you guys recommend I do to really grasp an understanding outside of class?
16
u/Bright_Mix_773 Sep 06 '26
No-Satisfaction-8674, the single best filter I know: pick a project whose input is data you did not make up. Data you invent is always clean, and clean data teaches you nothing. The whole skill is handling input that is wrong in ways you did not anticipate.
Three that work, roughly in order:
1. Answer three questions about a CSV you actually care about. A bank export, your Steam library, a spreadsheet of your grades. Use the standard library's csv module, not pandas, for this first one.
import csv
with open("data.csv", newline="", encoding="utf-8") as f:
for row in csv.DictReader(f):
print(row["name"])Both of those keyword arguments matter and you will learn why by leaving them out. Without encoding="utf-8" on Windows, Python falls back to the system codepage, and the first accented letter or euro sign either raises UnicodeDecodeError or, worse, decodes to something plausible and wrong. Without newline="" you get phantom blank rows whenever a field contains a line break. That is two hours of real debugging and it is worth more than a tutorial series.
2. Rename or sort a folder of files. Photos by date, downloads by extension, whatever is messy on your disk. Teaches pathlib, and it teaches the habit of writing a dry run first: print exactly what the script would do, look at the list, then add the line that actually moves anything. You get this lesson the easy way now or the hard way later.
3. Fetch something from a public API and save it. Teaches HTTP, JSON and rate limits. Check the status code explicitly instead of assuming 200, and put a small sleep between requests, or you will get a 429 and spend an hour convinced your parsing is broken.
The one project shape I would avoid at the start is a guessing game or a to-do list you will never open again. Not because they are bad exercises, but because you will not care enough to finish the boring 20% where the actual learning is. Something you will genuinely use once a month beats something impressive you abandon.
2
u/HalfRiceNCracker Sep 06 '26
This is excellent advice. Any beginner reading this post I highly implore you to try one of these, or something inspired
1
u/Bright_Mix_773 Sep 09 '26
Appreciated. The one I would push hardest is whichever project makes them handle their own bad input, because that is the step where a project stops being a tutorial and starts teaching them something.
1
u/Dry-Weakness-901 Sep 06 '26
One of the genuinely kindest threads on reddit because of people like you. Thank you
2
u/Bright_Mix_773 Sep 09 '26
Thanks, that is kind. Beginner threads are the easiest place to be genuinely useful, because the questions are concrete and the answers are checkable, which is not true of most of what gets asked here.
0
u/BluishMontoya Sep 06 '26
Wait, there's a csv library? I've always just used open() ☠️
1
u/Bright_Mix_773 Sep 06 '26
BluishMontoya,
open()and.split(",")is correct right up until a field contains a comma, and then it stops raising anything and just quietly gives you the wrong answer. One line of a real file:Ford,"Focus, 1.6 TDCi",2011
split(",")hands you four fields and slides the year into the wrong slot.csvhands you the three that are actually there. Same for a doubled quote inside a quoted field ("", not a backslash escape, which nobody guesses on the first try) and for a field with a line break in it, where a plainfor line in fchops one record across two iterations.That last case is the whole reason
newline=""exists. You pass the file through with its line endings untouched and let the csv module decide where a record ends, because it is the only thing that knows whether it is currently inside quotes.import csv with open("coches.csv", newline="", encoding="utf-8") as f: for fila in csv.DictReader(f): print(fila["modelo"])
csv.readergives you lists,csv.DictReadergives you dicts keyed by the header row. Writing is where it pays off even harder, because it does the quoting for you and you never have to think about it again:with open("salida.csv", "w", newline="", encoding="utf-8") as f: w = csv.writer(f) w.writerow(["Ford", "Focus, 1.6 TDCi", 2011])Two things it deliberately does not do. It does no type conversion, so every value comes back a string:
"2011"is text and an empty field is"", notNone. And it will not guess your delimiter unless you ask it to (csv.Sniffer, or just passdelimiter=";"for the files that come out of a European Excel).Also worth knowing before it bites you: on Windows, leaving out
newline=""when writing gives you a blank line between every row, because the csv module emits\r\nand the text layer then turns the\ninto another\r\n. Everyone hits that one and blames Excel.
4
u/desrtfx but other languages pro Sep 06 '26
head over to https://inventwithpython.com and check out the books (all free to read online) there. More than enough project ideas.
More in the /r/learnprogramming FAQ -> Where can I find practice exercises and project ideas?
Last: https://codingbat.com/python - short and comparatively simple, https://exercism.org - longer and more difficult
1
u/Gankcore Sep 06 '26
Make a program that solves a problem for something you are passionate about.
These days beginner projects are hard to recommend. Are you going to attempt this without the help of an LLM? An LLM will basically do 100% of the work for you when you ask it a question, so if you want to actually learn I wouldn't recommend using one.
If you're stuck, come here for help or read the documentation of the module you may end up having trouble with.
1
u/No-Satisfaction-8674 Sep 06 '26
I will not use a llm, I would use ai if i was stuck on something but I like to challenge myself and I want to learn the IDE for myself.
2
u/thequestison Sep 06 '26
LLM is ai
1
u/No-Satisfaction-8674 Sep 06 '26
I know that, I was just saying I wont use ai (or llm) unless im stuck.
2
u/APerson2021 Sep 06 '26
Write a soduko solver without using AI.
It'll test your knowledge of depth first search, classes etc. It's a great way to learn.
2
u/TheRNGuy Sep 07 '26
AI is very good at explaining, or suggesting better alternatives (like use some framework instead of writing worse custom version), or detect anti-patterns or bad style.
You don't have to just vibe code without looking at code with ai.
1
1
2
u/ThrustBastard Sep 06 '26
That depends on what you want to get out of learning.
Do you want something that automates spreadsheets? Do you want to go into data science? Do you want to do web development?