Tag: Tuple

  • Python Data Types : How they work

    Let’s embark on a journey into the fascinating world of Python data types, demystifying the concepts and shedding light on their connection with objects. As a Python enthusiast who loves to teach, I’m thrilled to guide you through this beginner-friendly exploration. Python Data Types: The Building Blocks of Information Imagine Python as a versatile toolbox,…

  • Variables and data types in Python

    Ah, Python variables and data types—a splendid place to embark on your coding journey! 🐍 You see, Python is like a linguistic marvel in the world of programming. For that reason, just as in a conversation, where words convey meaning, in Python, variables hold the keys to data. So, let’s delve into this captivating realm…

  • What is enumerate in Python

    The enumerate in Python is a built-in function. It takes an iterable object. And returns an iterator that produces tuples. The iterable object could be a list, tuple, or string. Moreover, it contains the index and the value of each element of the object. Here’s an example. Here we can use enumerate to iterate over…

  • What is for loop in Python give example?

    The for loop in Python is one of the main looping constructs. Usually we use the for loop when we want to iterate over the sequence.  This sequence could be a collection, such as tuple, list, or even a string. As a result of iteration, the placeholder variable takes every item as we iterate over…

  • Python collections comparison

    In our previous discussion, we have seen one of the most important collections List. Now we can go through python collections comparison. We’ve also seen how we can change the value of a list and change the Python collection. However, in some cases, we need to keep the value write-protected.  In short, we don’t want…

  • Tuple, List and Dictionary for Python beginners

    Python has many sequential types, lists of things. It has an output as follows. So it is of class ‘tuple’ and it has a list of things. Remember, tuple is immutable. You can not insert or update it. But you can iterate through it like this: It will give all the numbers you have inside…