Python 🐍

How to Multiply Integers with Floating Point Numbers in Python

To multiply integers with floating point numbers in Python, we use the multiplication operator (*). If the multiplication operator (*) appears between a number of type int and of type float or vice versa, then the numbers will multiply each other. The product of an int and a float is a float. If you want […]

How to Multiply in Python

In mathematics, we use the symbol Γ— to multiply numbers. It is the standard symbol for multiplication and it is called the multiplication sign. When we put the Python programming language into the picture, the symbol disappears but the multiplication fundamentals remain the same. In this post, you’ll learn how to multiply in Python. To […]

How To Add New line to String Using Python new line Character.

The Python Newline character is a special Python character that produces line breaks. It is made up of a backslash and the letter n (\n). All characters in a string that appear after the newline character will be printed on a new line Because of those special characteristics, it can also be called a line-break […]

Fix Python TypeError: List Indices must be Integers or Slices, not str

If you come across an error like this: TypeError: list indices must be integers or slices, not str? Do not worry, it is just hinting that you have used the wrong data type (in this case, a string) as an index of a list item, instead of using an integer. Let me explain a little […]

Python Trim Whitespace: How To Trim String Whitespace In Python Using strip(), lstrip(), and rstrip()

In Python and other programming languages, to trim whitespace is to remove any extra blank or empty space around a word or character in a string. In Python, we use the function strip() and its younger siblings lstrip() and rstrip() to trim whitespace in a String. We usually work with strip(), lstrip(), rstrip() when dealing […]

Django on_delete: The Significance of the on_delete Argument and Its 7 Options to Django Models.

You may have used the Django on_delete argument in almost every Django project you’ve built. Most of us certainly have, but most of us probably have no idea what this β€˜django on_delete’ argument actually does. This is because whenever we use a Foreignkey in our Django models, it is also mandatory that we add the […]

Django MySQL: How to Connect to MySQL Database from Django (Best Methods) πŸ”—.

Django, the Python web development framework that we all love, comes with many built-in features that are beneficial to the developer. At some point during the development of a Django project, you create a superuser whose signup details (username, email, and password) you can use to login into a beautiful, feature-rich admin panel where your […]

How to Install and Set up FastAPI Project on Your Computer: pip install fastapi.

This step-by-step guide will show you how to install FastAPI and set up a FastAPI project on your computer. We will start with a few requirements needed before one can install FastAPI and create a web project with it, then we will go step by step into installing FastAPI along with other dependencies. Last but […]

Scroll to top