Category: Python

  • Python Set and Dictionary

    Python Set and Dictionary belong to the collections or data structures. We have discussed lists and tuples before. With reference to the previous discussion we have also seen how lists and tuples differ in nature. The Python Set and Dictionary are also different.  Firstly, Set is an unordered collection of unique items.  Remember, unique items.…

  • 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…

  • What is the need of Python collections?

    Without the Python collections we cannot handle the big data. In short, the data structure or collections in python is super important. There are four types of Python collections. In this section we will try to understand List. One of the most used data types in collections is the List. We have discussed data types…

  • What are data types in Python?

    We have already seen data types in Python. But in this section we will dig deep and learn the topic in depth. Now in many programming languages, we explicitly mention the data type. We call them Strongly typed, or Statically typed languages. On the other hand, in Python it is not mandatory at all. We can…

  • What are literals in Python?

    In our previous discussion we have seen how we can assign value to a variable. We refer to that value as literals in Python. In other words, literals refer to raw data. As a result, there are different types of literals in Python.  Let’s start with numeric literals which are nothing but a decimal literal,…

  • What are variables in Python

    Consider variables in Python as containers that contain some data. It could be integer, string or boolean. At the same time, whenever a Python interpreter sees a variable it considers it as a named-location. In reality a variable stores data in the memory.  However, at the same time it tells the interpreter that this is…

  • What is Python Docstring?

    First of all let’s put one important concept in order. What is Python docstring? Is it the same as Python comments? The answer is no. We have discussed the role of Python comments before. Sometimes beginners may find them the same.  Because for multi-line Python comments we use three single quotes – (‘’’ comments can…

  • What are Python Comments

    Python Comments and Docstrings are an essential part of building any type of Python programming. We’ll learn in a minute. While we write any type of Python program, both comments and docstrings play an important role. However, they are not the same. On the contrary, they are different. What is the difference, we will discuss…

  • Statement and Indentation in Python

    Statement and indentation in Python are important concepts that a beginner should know at the very beginning. In this section, we will see how it works.  If you are new to Python, please visit the previous sections, where we have discussed keywords and identifiers. Besides that, we have also discussed how to start learning Python.…

  • What are keywords and identifiers in Python?

    Keywords and identifiers in Python separately refer to two different types of concepts. Therefore, don’t get confused. What are keywords in Python? Firstly, they are reserved words that we use for special purposes.  We’ll see in a minute what they are and how they work. Secondly, we cannot use keywords as names given to any…

  • How to learn Python?

    Every beginner asks this question – how to learn Python? Answer? It’s easy to learn Python. We’ll find that in the coming sections. How easy is it to learn?  Well, in a step by step guide we will see how easy it is.  Since this is the first step to start Python, we don’t have…

  • What is a decorator in Python?

    The decorator in Python is an interesting feature. What does it do and how does it work? We’ll discuss it in this section. Firstly, the decorator is a function itself.  Secondly, it takes in a function and modifies that function and after that returns it. While modifying, the decorator might add some functionality to the…

  • What are special parameters in Python?

    We can pass arguments or parameters to a Python function in two ways. That is why we’re discussing special parameters in Python. Why do we term these parameters special?  Let’s see. Firstly, we can pass an argument or parameter to the python function by position.  Secondly, we can pass it by keyword. And in that…

  • Python module introduction

    When we talk about python module, we think of default python libraries. Right? But it’s not true in every sense. Actually when we think of keeping our python code restoring its value we think of python modules. What does that mean? Let’s think of a Python interpreter.  When we close the interpreter, what do we…

  • Python function as argument

    We can pass any argument through a Python function. It could be a function itself. In other words, a function can take multiple arguments. However, to understand this concept, we need to understand another thing first. What does a python function do? It might take any amount of input. Right?  Then the python function adds…

  • Keyword arguments in Python

    Passing keyword arguments in Python is another way to define function. We’ve seen how we can define the default argument in python. However, passing keyword arguments represents one of the forms to define function. In python, it’s possible to define functions with a variable number of arguments.  We’ve seen one of them. In particular there…

  • Default argument in Python

    We can define the default argument in python in many ways. However, it represents one of the forms to define function. In python, it’s possible to define functions with a variable number of arguments.  We’ll see them one after another. In particular there are three forms.  Default argument in python is the first one we…

  • Fonctionne comme des objets de première classe Python

    Pourquoi disons-nous que fonctionne comme des objets de première classe en Python? Voyons comment nous pouvons apprendre cela. Parce que, dans Python, les fonctions peuvent agir comme d’autres objets. Qu’est-ce que cela signifie? Il mans en Python, les fonctions se comportent comme n’importe quel autre objet, comme un int ou une liste. Cela signifie que…

  • Functions as first class objects Python

    Why do we say that functions as first class objects in Python? Because, in Python functions can act as other objects. What does that mean? It mans in Python, functions behave like any other object, such as an int or a list. It all means, all operations we can do to objects, we can also do to a…

  • Énumération en python

    Nous créons des énumérations en Python en utilisant la syntaxe de classe. En conséquence, cela les rend faciles à lire et à écrire. Dans cette section, nous verrons différents types d’énumérations. Pour définir une énumération, nous utilisons la sous-classe Enum comme suit. Comme nous le remarquons, une énumération est un ensemble de noms symboliques, ou…

  • Enum in python

    We create Enumerations in Python using the class syntax. As a result, it makes them easy to read and write. In this section, we will see different types of enumerations. To define an enumeration, we use subclass Enum as follows. As we notice, an enumeration is a set of symbolic names, or members.  When we…