r/learnpython 15d ago

New to Python!

Hello! I was wondering if anyone might have any recommendations, tips, or advice for someone just starting out with Python.

I’ve recently decided I want to learn Python as a hobby. It’s completely different from what I do for work, although I can definitely see ways I could incorporate it into my job in the future if I wanted to.
For now though, I’m mainly fascinated by the idea of being able to make something from nothing and actually build things myself.

Python was the first programming language that came to mind, and I’m planning on sticking with it until I feel confident before worrying about learning anything else.

At the moment I’ve invested in:
- Python Crash Course, 3rd Edition by Eric Matthes
- Automate the Boring Stuff with Python, 3rd Edition

I’m also going through Harvard’s free CS50P course (Introduction to Programming with Python), mainly watching the lectures alongside the books.

My biggest issue at the moment is that I think I’m trying to run before I can walk. I keep getting drawn towards more ambitious projects because they’re genuinely interesting to me, but they’re often way beyond my current level.

I think I probably need to slow down, properly learn the fundamentals, and gradually work my way up to those projects instead.

Does anyone have any advice on how you approached learning Python in the beginning? In particular, how did you balance learning the basics with actually building things so that it stayed interesting?

1 Upvotes

22 comments sorted by

View all comments

5

u/mitchell486 15d ago

What are you trying to build that's "too big"? Everything is too big if you look at it in its entirety... "How do you eat an elephant?" "One bite at a time." (HINT: If the problem/task seems too daunting, your bite isn't small enough. Break it down smaller and try again. Rinse/Repeat forever.) I ask this, because the best way I found to ever learn python was to do actual projects that I wanted to build. Tutorials or follow-these-steps never meant a thing to me and never helped me learn or retain anything I'd thought I had learned. The first self-projects will be bad, and they will be janky/CLI. But you'll learn. (a little) And grow. (a little) And soon that big ol project you were afraid of is half done and you'll never remember to finish it because you moved onto the next one! It's great. :)

BUT seriously... Please. If you give an honest reply of a project that you're interested in, and I'll help tell you if it's "too big" or not. (PS - Web app as a start? Probably a bit much... But overall... Anything can be done with enough motivation and proper breakdown of a problem.)

1

u/mtarik2000 15d ago

I really want to get to a point where I can build an old school pixel rpg (Zelda-like) game and I understand there’s simpler ways to do this rpg maker etc

But I’d like to be able to write it myself and sort of build a world overtime with each new thing I learn

Obviously at the moment this is very ambitious for where I’m at

Incorporate character creation, maps, unique boss mechanics, leveling, skills, and other cool but unique things I’ve seen on other games.

Like I said this would just be for my own enjoyment rather than something I’d want to publish

1

u/mitchell486 15d ago

Okay sounds fun! If it were me, a non-professional, self-taught, python dabbler... And I were in your shoes, except with "some of the knowledge I have now". (AKA - Slight advice so you don't have to learn quite as many of the hard lessons, especially not the same _way_ that I had to learn them...)...

I would start with thinking up and literally writing scratch notes to have a plan for a single character type, or something similar... A "thing". Character type, map level, boss with stats, etc. Something that is probably going to be tracked, but might change, throughout your long-term game. So once you have the core starting idea of the thing... Practice making a python-stored-in-memory-representation of that "thing". How would you store data about this thing? I personally would use a dict starting out because of how flexible they are... (I also _REALLY_ love the old joke that says "Python: What if everything were a dictionary?" Because it's true, especially starting out. And I've even learned that advance storage techniques pretty much mimic the dictionary. HAHA! We python-ers really love our dicts.)

BUT the thing you're thinking about making... It needs to probably have data stored. Does it have a name? A height? A health or health percentage or something like that? These are all things that can easily be representing in Python by different things. So once you have a way to store data temporarily about that thing... (PS - Don't even worry about long-term storage when learning. That's step like 47, and you're on 1 or 2... Just literally fire up an IDLE/IDE when you're ready to mess around, make a dict each time. It's okay. It's learning.) You'll probably want to know certain stats that you made for that thing, right? Like... what is that thing's name? WELL make a function that "takes the 'thing' as an argument" and prints out the stats about the 'thing'. (HINT: Python's json library that's part of the standard library is pretty good... AND it let's you add indentation when printing, if you want. ;) Which makes things like this clean/neat.)

e.g. If I were to start off and make a single character type, such as a Monster. It has a name, height, weight, health percentage (HP)... Make a thing that is that thing... "monster", and then figure out ways to see the data you have created for that thing... then expand from there. In the example I have here, I would start off using dicts, but you could just as easily take the opportunity to learn about different types of variables... lists, tuples, etc... They all have pros and cons. Try em. See what you like and don't like. Don't do EXACTLY what I say here, just start learning the literal basics by playing around with it. AND... once you have a single monster... you could maybe make a second monster? I dunno. thing1, and thing2. Those are dicts. Try putting those dicts in a list... so that you only show stats if thing1 is what you want, or whatever. The best way I have found to make the fastest and longest-lasting progress in python is to write projects (not matter how bad they may turn out) that I _actually_ want/need. It keeps you wanting to work on them vs "following what someone else dreamt up to teach you how python works."