Programming

Programming is the process of writing computer understandable instructions. These instructions can be written using languages known as computer programming languages. Java, Python, C#, C, and C++ are some of the popular ones.

4 Ways to Swap 2 Variables in Python

4 Ways to Swap 2 Variables in Python

Ways to Swap 2 Variables in Python: In computer programming, the act of swapping two variables refers to mutually exchanging the values of the variables. For example, if a = 5 and b = 6, then after swapping these two variables, a = 6 and b = 5. To perform this, there are many ways that one can follow. Here …

4 Ways to Swap 2 Variables in Python Read More »

What does if __name__ == “__main__”: do?

What does if __name__ == “__main__”: do? The best answer I found after searching for it in Google was in StackOverFlow. According to it, whenever the Python interpreter reads a source file, it does two things: it sets a few special variables like __name__, and then it executes all of the code found in the file. …

What does if __name__ == “__main__”: do? Read More »

Python Program to Send Emails Using Yagmail

Sending mail using yagmail

With Yagmail, sending e-mail using a Python program is easier than ever before. Yagmail – Yet Another Gmail/SMTP Client is a user-friendly API that simplifies the process of sending emails. In this post, I am going to share how to use yagmail, the API described above. If you want to read the full documentation of this …

Python Program to Send Emails Using Yagmail Read More »

What the F*** is F-string in Python

F-strings in Python

Python provides several ways to format strings. These different ways have their own advantages and disadvantages. Python 3.6 and above come with another method of string formatting (formally termed as string interpolation) known as f-strings” or Formatted string literals PEP 498. I knew about it recently while working on a Kattis problem with a friend.  …

What the F*** is F-string in Python Read More »

Differences between sort() and sorted() in Python

Sorting is a very common problem that many programmers may come across. Like any other programming languages, Python has its own built-in sorting methods. These sorting methods are sort() and sorted(). In this post, I will share the differences between these two methods and how these can be used in programs. I found these methods …

Differences between sort() and sorted() in Python Read More »

How to use Switch Case Statements Python

Python Switch Case Statements

Unlike many programming languages, you may know like Java and C, Python does not support switch case construct. I came to know about this while converting a Java program to Python program from a git repository. In this post, I am going to share how to implement switch case problems in Python so that you …

How to use Switch Case Statements Python Read More »

How to Use OpenCV in PyCharm

OpenCV in PyCharm

OpenCV in PyCharm: In this post, I will share about how to use OpenCV in Pycharm. Pycharm is an incredible Python IDE. It is a product of JetBrains. It is available both as the community(free) edition and professional (paid) edition. I use the community edition of it and works great for my study purpose.  Check …

How to Use OpenCV in PyCharm Read More »

Coding VS Programming

Coding vs Programming

Coding and programming are two words in the field of computer science or software development often taken interchangeably. But coding and programming are two different things. Here let us look into this differences – Coding vs Programming. The differences between coding and programming can be understood from its definition itself. With respect to the different …

Coding VS Programming Read More »