Nikhil

What is __ init __.py in Python? – Give an example

When developing multiple python packages and codes, or working with multiple directories, we often come across the __ init __.py file in Python programming language. In this article, we will learn, what is __ init __.py file? Also, we will learn about Python packages and also python programming language directory structure. Table Of Contents What

What is __ init __.py in Python? – Give an example Read More »

What is `__init__` method in Python class?

In Python OOPS programming every one must have come through this __init__() method. In this Python tutorial, we will learn What is __init__ method in Python class. Table Of Contents Introduction to __init__() method __init__ and Inheritance Summary Introduction to __init__() method In Object-Oriented Programming, we have constructors, which are used to initialize the member

What is `__init__` method in Python class? Read More »

How to use super() with `__init__()` method in Python?

In this article, we will learn to use super() with __init__() method in Python. But before lets learn about super() and __init__() method. Table Of Contents What is __init__() method ? Using ‘ super().__init__() ‘ Summary What is __init__() method ? The __init__() is a special method in python programming language which is also known

How to use super() with `__init__()` method in Python? Read More »

What is the alternative of switch statement in Python?

In this article, we will discuss about the alternatives of switch statement in Python. Table Of Contents Introduction New Switch Statement with match and case keywords in Python Alternative of Switch Statement in Python: If-Else-Elif Alternative of Switch Statement in Python: Using dictionary Summary Introduction In other programming languages, like C++ and Java, we have

What is the alternative of switch statement in Python? Read More »

Remove leading whitespace from String in Python

In this tutorial, we will learn about some methods using which we can remove leading whitespaces from a string in Python Programming language. Table Of Contents Introduction Method 1: Using lstrip() Method 2: Using sub() Summary Introduction Suppose we have a string with leading whitespaces i.e. Now we want to remove leading whitespaces from this

Remove leading whitespace from String in Python Read More »

Scroll to Top