A FEEDBACK ON A LESSON ON VARIABLES AND DATA TYPES #200687
sethapp88
started this conversation in
A Welcome to GitHub
Replies: 1 comment
-
|
Please give me feedback on my draft and suggest improvements |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Introduce yourself
My name is Seth Appiah i am 15 years and I am building a coding educational website
⭐ Variables & Data Types
*Intro to Programming
When you open a game, something is always happening in the background—even when you’re not pressing anything.
Your score is being tracked.
Your level is being stored.
Your health is being updated.
But here’s the interesting question:
It doesn’t “remember” like a human does. Instead, it stores information in small labeled places inside memory.
These are called variables.
🧠 Variables: The idea behind memory
A variable is simply a name that stores a value.
Think of it like a labeled box.
If you have a box labeled score, you can put a number inside it:
Now the program doesn’t need to remember the number directly. It just remembers the name
score, and looks inside whenever it needs the value.So instead of thinking:
the program thinks:
And the best part?
That value can change.
If the player earns more points:
The same box is updated. The name stays the same, but the value inside changes.
🌍 Why variables matter in real life
Every app you use depends on this idea.
A social media app might store:
A game might store:
A shopping app might store:
Without variables, none of these apps could function. Everything would reset instantly.
📦 What is data?
Before we go deeper, we need to understand what variables store.
That thing is called data.
Data is just information.
It can be anything:
"Seth"159.99TrueSo when you write:
you are storing data (the value) inside a variable (the container).
🔤 Values inside variables
Every variable holds a value.
That value can be different types of information.
For example:
Even though these all look different, they are all just data stored in variables.
🔢 Data Types: how the computer understands data
Now here’s something important:
The computer doesn’t just see “data.” It needs to know what kind of data it is.
That’s what data types are.
A data type tells Python how to treat a value.
🔢 Numbers (Integers)
Whole numbers are called integers.
These are used when you are counting or measuring something simple.
🔢 Numbers with decimals (Floats)
When numbers have decimals, they are called floats.
These are used when precision matters.
🔤 Text (Strings)
Anything inside quotes is text, called a string.
Strings are used for words, sentences, and anything written.
🔘 True or False (Booleans)
Sometimes a value is just yes or no.
In programming, that becomes True or False.
These are used in decisions.
⚪ Empty value (None)
Sometimes, something has no value yet.
This means:
🔁 How variables change over time
Variables are not fixed.
They can update as the program runs.
Think of it like updating a scoreboard in real time.
The label stays the same—but the value changes.
One of the most common mistakes is forgetting that text must be inside quotes.
Python thinks
Sethis a variable, not text.Correct version:
Another mistake is mixing text and numbers incorrectly:
This fails because
"15"is text, not a number.🌍 Real-world mental model
You can think of a program like a system of labeled boxes:
Everything the program does is just:
🧪 Mini challenge (think like a programmer)
Imagine you are building a game.
What variables would you need?
Try to think of:
Now you are already thinking like a developer.
🏁 Summary
If you understand this lesson, you understand one of the most important ideas in programming:
Everything in programming builds on this.
🎯 Final idea
If you strip away all complexity in software:
Games, apps, websites, AI—they are all built from this simple idea.
Links (optional)
No response
Where are you in your GitHub journey?
Brand new to GitHub
And where are you going next on GitHub?
I want to try building a lesson on input and output
What technical skills or projects are you working on?
I am building a coding education website to teach people how to code
Got a question for us? (optional)
No response
Beta Was this translation helpful? Give feedback.
All reactions