Decimal to Binary in Python

In the previous article we discussed how a string can be reversed, now let us explore number system conversions in Python. We are given a non-negative integer, our task is to write a function that takes the integer as an argument and then returns the binary value. The result should be stored in a string …

Read more

Reverse a String in Python

In the previous article, we were required to validate if the reversed string or string elements were the same as the one in original ordering. Hence, we saw two ways in which it could be done…in this article we will explore a bit more of the same concept of how to reverse a string in …

Read more

Slicing in Python (Tuples, Strings, Lists)

In the previous article we explored the conversions of Binary to Decimal. Now we will explore the concept of slicing, slicing in Python is the process of extracting a specific sub portion of an iterable data structure, according to the user-specified criteria. Very often, it is necessary to get not one certain element, but a …

Read more

String Comparison in Python

In the previous article we discussed some of the frequent string operations, now let us look at comparing the values or characters of strings. Python allows various different comparison operators to be allowed for this purpose. Operators for String Comparison in Python Let us examine a program using comparison operators: How does the comparison of …

Read more

Check for Palindrome in Python

In the previous article we explored pattern searching in Python, on this article we will see how we can check for Palindrome in Python logic. Before we delve further, think of the date 10-02-2001 which can be expressed as 10022001. From either side, left to right or right to left we arrive at the same …

Read more

Binary to Decimal Conversion in Python

As we have seen in the previous article, the various ways in which we can convert from decimal to binary. Let us now explore the reverse that is Binary to Decimal Conversion in Python. Imagine that we are given a string that represents binary value of a number, we need to write a function that …

Read more

String Operations in Python Part 1

In the previous article we saw the use of Formatting Strings in Python, in this article we are going to discuss operations on Strings and methods of Strings. Working with String Operations in Python The first operation we are going to discuss is checking whether a given string is a substring of another string or …

Read more

Common String Operations in Python

In the previous article we have seen some of the list operations and string operations in python. Now we will look at some more vital string operations, keywords or functions in Python. Transformation/Manipulation of Strings There are a number of fun methods that we can use to transform our string text. Among those more important for …

Read more