DEV Community

Cover image for 🐱 NECOZ School Picnic When 30 Cats Went Crazy! 🚌Python Data Types
Sᴛᴀʀ⭐ for Necoz

Posted on

🐱 NECOZ School Picnic When 30 Cats Went Crazy! 🚌Python Data Types

It was 7 AM at NECOZ School. Everyone was excited because today was the biggest school picnic ever! πŸ₯³

All 30 Cats arrived at school with their bags. One brought chips, another brought chocolates, and one Cat even brought a pillow!

But here was the biggest surprise: King Nyaomaru was also joining the picnic! πŸ‘‘

The teacher shouted, "Everyone, get ready and find your seats!"

One Cat replied, "Teacher, someone is already sleeping on my seat!" πŸ˜‚

And just like that, the NECOZ adventure began!

πŸ”’ 1. Integer – How Many Students?

The teacher started counting all the Cats.

students = 30
buses = 2
Enter fullscreen mode Exit fullscreen mode

An Integer stores whole numbers.

King Nyaomaru said, "30 Students and 2 Buses! Perfect!"

Suddenly, a Cat shouted, "Your Majesty! One Cat is sitting across THREE seats!" 😭

πŸ’° 2. Float – The Picnic Budget

The King checked the picnic budget.

budget = 1500.50
Enter fullscreen mode Exit fullscreen mode

A Float stores decimal numbers.

The King said, "We have enough money for Pizza!"

One Cat immediately shouted, "Please reserve TWO pizzas for me!" πŸ•

πŸ’¬ 3. String – Everyone's Names

The teacher opened the attendance register.

king = "Nyaomaru"
school = "NECOZ School"
favorite_food = "Pizza"
Enter fullscreen mode Exit fullscreen mode

A String stores text, such as names and words.

The teacher asked, "Who is Nyaomaru?"

All the Cats shouted together, "OUR KING!" πŸ‘‘

πŸ€” 4. Boolean – Is Everyone Present?

The teacher checked the attendance.

all_students_present = True
Enter fullscreen mode Exit fullscreen mode

Boolean has only two possible values:

  • True
  • False

The teacher announced, "Everyone is here!"

Suddenly, a voice came from the top of the bus.

"TEACHER! I'M HERE TOO!"

πŸŽ’ 5. List – The Lunch Box Army

All the Cats opened their lunch boxes.

lunch_boxes = ["Pizza", "Burger", "Sandwich", "Juice"]
Enter fullscreen mode Exit fullscreen mode

A List stores multiple items in one variable.

One Cat said, "My lunch box has something special!"

The teacher asked, "What is it?"

The Cat replied, "HUNGER!"

πŸ”’ 6. Tuple – The Picnic Schedule

The teacher prepared the picnic schedule.

schedule = ("Breakfast", "Games", "Lunch", "Photography")
Enter fullscreen mode Exit fullscreen mode

A Tuple stores multiple items, but its elements cannot be changed after creation.

The King said, "Excellent schedule!"

One Cat asked, "Where is sleeping time?" 😴

πŸ“š 7. Dictionary – Student Information

The teacher decided to record information about the King.

king = {
    "name": "Nyaomaru",
    "planet": "NECOZ",
    "color": "Green",
    "role": "King"
}
Enter fullscreen mode Exit fullscreen mode

A Dictionary stores information in Key-Value pairs.

The King said, "Wonderful! My entire information is in one place!"

🍎 8. Set – No Duplicate Fruits!

The teacher asked everyone to write down their favourite fruits.

fruits = {"Apple", "Mango", "Banana", "Apple"}
Enter fullscreen mode Exit fullscreen mode

A Set stores unique items. Duplicate values are automatically removed.

So Apple appears only once!

One Cat shouted, "But I WANT TWO MANGOS!"

🌳 9. NoneType – Nothing Assigned Yet!

The teacher reserved a seat for a Cat, but its seat number was not decided yet.

seat_number = None
Enter fullscreen mode Exit fullscreen mode

None represents the absence of a value.

The Cat asked, "Teacher, where is my seat?"

The teacher replied, "Don't worry! We will find one!"

πŸŽ‰ THE BIG PICNIC TWIST!

Finally, all the Cats reached the picnic spot.

King Nyaomaru announced:

"Today, nobody is allowed to do Coding!"

But suddenly, one Cat opened its laptop.

The King asked, "CODING? Even at a picnic?"

The Cat replied:

"Your Majesty, I am just learning Python!"

The King thought for a moment and announced:

"FINE! FIRST PIZZA, THEN PYTHON!" πŸ•πŸ

And that was how the NECOZ School Picnic became legendary!


🧠 Python Data Types –

Data Type Example
Integer (int) 30
Float (float) 1500.50
String (str) "Nyaomaru"
Boolean (bool) True
List (list) [1, 2, 3]
Tuple (tuple) (1, 2, 3)
Dictionary (dict) {"name": "Tom"}
Set (set) {1, 2, 3}
NoneType None

Top comments (0)