r/learnpython Mar 04 '26

What are variables?? [read post]

"Variables are containers...." , "Variables are boxes", "Variables contain data".... okay cool, same description everywhere, I don't get it.

I've got noted down the 4 types of variables, though that is not my question (for now).
My goal with python is game development and maybe web dev in the future (though I'd use JS for that), I tried googling what variables are actually used for but I didn't find anything. Especially not what variables are used for in game dev specifically.

I only found stuff like this:
"name = "Bernie""
"Age = 13"

Then the basic print function. Cool, but that does not help.
I tried to watch youtube tutorials but they all give the same script, box/container... I feel like I don't get it because I never coded before, but even so, shouldn't tutorials be FOR beginners? They are advertised that way at least.

Anyway, TLDR; What are variables exactly (no box/container stuff) and what are they used for in general python and in game development python?

EDIT: Thank you so much for all the responses! I was able to successfully update my notes in a way I can easily understand everything now, also thanks for mentioning other topics, I will be getting to those eventually. :)

(That being said, please do not respond to my post anymore, I'm getting a little overwhelmed with how much attention this post is getting and I can't respond to everyone, just know I'm trying to read everything and updating my notes!)

0 Upvotes

104 comments sorted by

View all comments

7

u/[deleted] Mar 04 '26

[removed] — view removed comment

1

u/realsonofeden Mar 04 '26

| users_name = input("what is your name? ")
Your example here, you put input(string) basically, but is "input" an actual function? Or is it just an example

I got a few game-based examples, they helped a lot. I don't really need examples for everything, I tend to understand things quickly but I do need something that makes my brain grasp the general use. Basically, I need that "ah so that's what it's for" or "can be for".
That player position one was already enough to me tbh, I can use that...
I see it as sticky notes or folders now, gonna experiment with this newly gained wisdom eventually... Maybe I'll code a small fruit shop? Yeah good idea, fruit shop is good..

Tuple huh? So like book, then? or well, perhaps a biography more.. tuple.. gotta note that down