Python | Split String and Count Results

✨Summary: Split the string using split and then use len to count the results. Minimal Example Problem Formulation 📜Problem: Given a string. How will you split the string and find the number of split strings? Can you store the split strings into different variables? Example In the above problem, the delimiter used to split the … Read more

Python Split String at First Occurrence

⚡Summary:  Use given_string.split(‘sep’, 1) to split the string at the first occurrence of a given delimiter. Another approach to solve the problem is to use given_string.partition(‘sep’). Minimal Example Problem Formulation  📜Problem: Given a string. How will you split the string at the first occurrence of a specific separator? Example Consider that you are given a … Read more

Python Hex String to Big Endian (Bytes/Integer)

What Is Big/Little Endian? Computers perform computations on data that is represented with bytes, i.e., sequences of 0s and 1s. A computer program manipulates data by loading data from memory (RAM, Cache, Disk, SSD), performing computations based on that data, and storing the resulting data back into the memory. A computer program loads and stores … Read more

Python Split String by Uppercase (Capital) Letters

✨Summary: You can use different functions of the regular expressions library to split a given string by uppercase letters. Another approach is to use a list comprehension.  Minimal Example Problem Formulation 📜Problem: Given a string containing uppercase and lowercase letters. How will you split the string on every occurrence of an uppercase letter? Example In … Read more

Python Split String Case Insensitive

✨Summary: Use the re.split function of the regex module to split the string using the given delimiter and set the regex flag re.IGNORECASE to ensure a case-insensitive split. Minimal Example Problem Formulation 📜Problem: Given a string containing a mixed blend of uppercase and lowercase characters. How will you split the string using a separator that … Read more

How to Interpolate Strings

Problem Formulation and Solution Overview This article will show you how to interpolate strings in Python. ℹ️ Interpolation is used when a string contains a placeholder for a variable or a calculation. The string is evaluated, and the placeholder is replaced by the passed data. To make it more interesting, we have the following running … Read more

Python Split String at Last Occurrence

⚡Summary:  Use given_string.rsplit(‘sep’, 1) to split the string at the last occurrence. Another approach to solve the problem is to use given_string.rpartition(‘sep’) Minimal Example: Problem Formulation  📜Problem: Given a string. How will you split the string at the last occurrence? Example Consider that you are given a string with multiple occurrences of the word “scream”. … Read more

Python | Split String Convert to Int

Summary: You can split a string and convert it to integer values by either using a list comprehension or Python’s built-in map() function. Minimal Example Problem Formulation 📜Problem: Given a string containing integers separated by a specific delimiter. How will you split  the string using the given delimiter and store the integer strings into a … Read more

Solidity Function Calls – Internal and External

In this article, we’ll take a closer look at function calls in general, specifically internal function calls in Solidity. It’s part of our long-standing tradition to make this (and other) articles a faithful companion and a supplement of the official Solidity documentation. You can watch my explainer video on the topic here—I’ll talk about function … Read more