Far away in the galaxy, there was a beautiful planet called necoz. 🌌
One day, the King of necoz announced something very exciting:
📢 Attention, everyone! Today we are hosting the biggest Cat Party in the entire galaxy! All cats are invited!
Cats from different galaxies started arriving. Some came by UFO, some came by spaceship, and one cat even arrived on a flying pizza! 🍕
🛸 Scene 1: 30 Cats and a Confused King
The party finally started.
The King looked around and shouted:
WHAT?! There are 30 cats here! Who is going to count all of them?
Suddenly, a little cat wearing sunglasses said:
Bro, just use Python!
The King opened his laptop and wrote:
cats = 30 print(cats) Output:
30 The King: "WOW! Python counted them without even asking for their names!"
And that's how the King discovered Variables.
A variable is like a container that stores information.
In this example:
-
catsis the variable name. -
30is the value. -
=is the assignment operator.
🍕 Scene 2: 10 More Hungry Cats!
Suddenly, a UFO landed near the party.
10 more cats came out.
Their leader shouted:
WE WANT FOOD! WE ARE STARVING!
The King replied:
Bro, this is a party, not a free restaurant!
He updated his Python code:
cats = 30 cats = 40 print(cats) Output:
40 The King: "WAIT! We had 30 cats, and now we have 40!"
That's the magic of variables. We can change the value stored in a variable.
🎂 Scene 3: The Great Cake Disaster
The King ordered 5 cakes for the party.
But one cat grabbed a cake and shouted:
THIS CAKE IS MINE!
Another cat replied:
NO! I SAW IT FIRST!
Meanwhile, a third cat(@hanzla ) was already escaping with the entire cake box. 😂
The King decided to store the information in separate variables.
cats = 40 cakes = 5 print(cats) print(cakes) Output:
40 5 Now Python knows that there are 40 cats and 5 cakes.
Each variable stores its own value.
😹 Scene 4: Different Types of Data
The King wanted to record more information about the party.
So he wrote:
planet = "necoz" cats = 40 party_started = True cake_price = 250.50 His assistant cat asked:
Why do these values look different?
The King explained:
| Variable | Value | Data Type |
|---|---|---|
planet | "necoz" | String |
cats | 40 | Integer |
party_started | True | Boolean |
cake_price | 250.50 | Float |
Let's understand them:
- String: Stores text or words.
- Integer: Stores whole numbers.
- Boolean: Stores
TrueorFalse. - Float: Stores decimal numbers.
The cat replied:
OMG! So I can also become a variable?
The King: "Yes, but please stop eating the cake!" 😂
💻 Scene 5: The Final Python Experiment
The King decided to display all the party information together.
planet = "necoz" cats = 40 cakes = 5 party_started = True print("Welcome to", planet) print("Total Cats:", cats) print("Total Cakes:", cakes) print("Party Started:", party_started) Output:
Welcome to necoz Total Cats: 40 Total Cakes: 5 Party Started: True The King shouted:
FINALLY! I AM A PYTHON DEVELOPER!
But suddenly, a cat @effessdev interrupted:
Developer later, bro. First, order 40 more cakes!
And that's how the biggest cat party in the galaxy continued all night. 🐱🎉
