• 23 September

    Convert 0 to 1 and 1 to 0 in Python

    In this post, we will see how to convert 0 to 1 and 1 to 0 in Python. Ways to convert 0 to 1 and 1 to 0 in Python There are times when you need to convert 0 to 1 and 1 to 0. For example: Flipping a bit in binary number. There are […]

  • 23 September

    TypeError: Object of Type Datetime Is Not Json Serializable in Python

    In Python, the datetime library allows us to create objects of the datetime class that can store and process date and time values efficiently. We can manipulate these objects according to our needs using the wide range of functionalities provided by this library. JSON is a type of encoding for data that is used frequently […]

  • 23 September

    Add Tuple to List in Python

    Add tuple to list in Python Tuples and Lists are two of the most commonly used collection objects in Python. They both can store multiple elements and provide access to these elements using their indexes. There are a few differences associated with them as well. Tuples are immutable, which means that once created they cannot […]

  • 23 September

    Convert Datetime to Unix Timestamp in Python

    Dates and Unix Timestamp Dates can be a tricky value-type to handle in programming. In Python, we have the datetime library that provides objects of datetime class that can store and processes the date values efficiently. Let us now discuss the Unix timestamp. When computer systems were introduced it became a necessity to follow a […]

  • 23 September

    Find All Substrings of String in Python

    Dealing with and manipulating strings is a fundamental part of understanding the basics of Python, and the use of substrings and strings can be seen in essentially every Python program. This tutorial focuses on one such part of substrings. The article demonstrates the different approaches available to find all substrings of string in Python. what […]

  • 21 September

    Print Bytes without b in Python

    Just as a string is a collection of Unicode characters in Python 3, bytes are a collection of objects. Bytes can be stored on a disk and internally everything is stored as bytes in a computer. The relation between strings and bytes is that a string can be encoded into a bytes object. To make […]

  • 21 September

    Print Dictionary Line by Line in Python

    Python provides four data types for collecting and storing data. These data types are also known as Python Collections. One of these four data types is a dictionary. A dictionary is capable of storing the data in key:value pairs, due to which there are certain styles in which it can be printed. This tutorial focuses […]

  • 20 September

    Print int as hex in Python

    1. Introduction to the Problem Statement In Python, converting and printing an integer as its hexadecimal representation is a common task, especially in applications dealing with low-level data processing, cryptography, or memory address manipulation. Scenario: Let’s consider we have an integer, say 255. Our task is to convert and print this integer in its hexadecimal […]

  • 20 September

    Print Unicode Character in Python

    1. Introduction Handling Unicode characters is a critical aspect of modern programming, especially in a globalized environment where software applications need to support multiple languages and character sets. Python, being a widely-used language, provides several methods to handle and display Unicode characters. This article will explore these methods in both Python 2 and Python 3, […]