PYTHON – Tuple, Set, Dictionaries

Once upon a time, in a magical kingdom of Python, there were three special friends named Tuppy the Tuple, Setty the Set, and Dicky the Dictionary. Each of these friends had their own unique way of organizing and keeping things.

Tuppy the Tuple

Tuppy was like a magical box that could hold a list of things, but once you put them in, you couldn’t change them. Tuppy loved to keep a list of his favorite fruits. Let’s see Tuppy in action:
Even though Tuppy couldn’t change the fruits once they were inside, he loved keeping them safe and in order. If you ever wanted to know what his second favorite fruit was, you could simply ask:

Setty the Set

Setty was like a magical basket that could hold a collection of things, but he never allowed any duplicates! Setty loved to collect unique shells from the beach. Here’s how Setty keeps his collection:
If someone tried to add another conch shell to the basket, Setty would just smile and say, “We already have one!” Setty’s collection would still look the same:
Setty also loved to check if a particular shell was in his basket:

Dicky the Dictionary

Dicky was a magical book that could store pairs of things – a word and its meaning. Dicky loved to keep information about his friends. Let’s see Dicky at work:
If you ever wanted to know something about one of Dicky’s friends, you just had to ask:
Dicky could also add new friends to his book or change the information about existing ones:

The End

And so, in the magical kingdom of Python, Tuppy, Setty, and Dicky lived happily, helping everyone keep their things organized in their own special ways. And just like that, with the help of Tuppy, Setty, and Dicky, we can do amazing things with Python! The end.
Unlock your child’s coding potential with our engaging, story-driven lessons! Enroll today and contact us for more details to embark on this exciting journey! WhatsApp us at http://wa.me/918825618377

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *