• Get variable name as String in Python
    01 October

    How to get variable name as String in Python

    In Python, there are several ways to convert a string to a variable name, but the reverse process is not exactly utilized so often in the programming world. This article focuses on how to get a variable name as a string in Python. What are variable names in Python? The term variable can be defined […]

  • Python hex to bytes
    31 May

    Convert Hex to bytes in Python

    💡 Outline You can use codecs’s decode() function to convert Hex to bytes in python. This method works for Python 2.x and Python 3.x Here is an example: [crayon-617912a4463d6663635300/] In the world of programming, there are many conversions of data types that programmers have to perform that best suit their problem statements. One of these […]

  • Remove commas from String in Python
    23 May

    Remove comma from String in Python

    💡 Outline You can remove comma from string in python by using string’sreplace() method. Syntax: [crayon-617912a446fa5755069190/] In this tutorial, we will take a sample string with a couple of commas in it and we will see some methods to remove comma from string in Python. Using replace() function to remove comma from string in Python […]

  • Add character to String in Python
    21 May

    Add character to String in Python

    Strings are considered as a sequence of characters in programming. In Python, string objects are considered immutable. What this means is that string objects cannot be changed once created, and a new string is created with a different block of memory when we edit a string. In this article, we will discuss how to add […]

  • Python find number in String
    16 May

    Python find number in String

    Extracting specific letters, phrases, words, and some specific characters is a very generic thing to do in the world of programming. In all these tasks, extraction of numbers and their occurrences from a string or a set of a string is also carried out very often by the user. Users can carry this task in […]

  • 13 April

    How to Format Float to 2 Decimal Places in Python?

    In this article you will learn - How to Format a Float With Two Decimal Places in Python?

  • 11 April

    Python Remove Newline from List

    🎯 Objective: In this article, we will discuss the methods to remove ‘\n’ or newline characters from a list. Introduction In a string, the ‘\n’ represents newline. But having them in your list can be a problem if you want to extract a given string from a list with no escape characters. This means, if […]

  • 03 April

    Sort String Alphabetically in Python

    In this article you will learn:- How to sort a string alphabetically in Python?

  • 30 March

    Python Split String by Comma

    In this article you will learn how to split a string by comma as a separator.