Pattern Searching in Python

In the previous article we saw how String comparison works, in this article we will see how we can deal with a common computer science problem ..we have a large text and then we have a pattern. Our task is to find all occurrences of this pattern within this large text. This is a very … Read more

Comprehensions in Python

In the previous article we saw how we could obtain the even and odd elements of a list, separately and return them. Now we will explore the concept of Comprehensions in Python with regards to lists, sets and dictionaries. What is List Comprehension? List Comprehension provides us a shortcut to create a new list from … Read more

While Loops in Python

In the previous lesson we have seen why loops are essential in programming languages, in this article we will explore a common type of loop present, that is the While loops in Python. While loop is a loop which first checks whether a particular condition matches, and then executes the statements which are embedded within … Read more

Loops in Python

In the previous article we have seen the Calculator implementation , now we will go through the concept of loops in Python. Looping structures are instrumental in reducing the repeated statements or complexity of code. Let us look at the example of multiplication tables. We need to write a program that accepts a user input … 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

Pyramid pattern in Python

In the previous article we explored the printing of Inverted triangle patterns in Python, now we will look at the implementation of Pyramid pattern in Python. We accept the input value from the user and print a * pattern resembling a pyramid structure which is respective to the number entered by the user in it’s … Read more

Inverted Triangle pattern in Python

In the previous article we explored the implementation and approach towards Triangle pattern in Python, now we will explore the concept and implementation of the Inverted Triangle pattern in Python. It operates according to the user input, for example for the number 4 it would return: Implementation/Working of Inverted Triangle pattern in Python The pattern … Read more

Printing of Triangle Patterns in Python

In the previous article we explored the printing of square patterns in Python, now let us look at another common printing pattern, the printing of triangle patterns in Python. The program prints the triangle according to the respective values given by the user, suppose the user enters the value of 4 the resultant output is: … Read more