Author Archives: Singh

Python Program to Multiply Two Matrices

Here in this article, we have provided a python source code that asks the user to enter the elements for two matrices and in the output, it shows their multiplication as a result. Prerequisite topics to create this program. Python Loop Python List Comprehension Python Nested for Loop Python Matrix or List Matrix: A matrix is… Read More »

Python Program to Remove Punctuations From a String

Here in this article, we have provided python source code which can remove all punctuations from a string. Prerequisite topics to create this program Python For loop Python String Python in operator Python if…else statements Steps Ask the user to enter a string. Create a string that contains all the punctuations. create an empty string.… Read More »

Python Program to Shuffle Deck of Cards

Here in this article, we have provided a python program which can shuffle a deck of card. Prerequisite topics to create this program. Python Loop Python Modules Python Random Python Built-in functions Steps import the random and itertools in the program. using the itertool module create a list of tuples where each tuple contains the… Read More »

Python Program to Find HCF or GCD

Here we have provided two python source code to find the GCD or HCF of two numbers. Prerequisite topics to create this program. Python Input, Output Python User-Defined Function Python Recursion Python if…else statements Python For loop There are two common techniques we can use to find the HCF of two numbers, one is by… Read More »

How to Check if a Python String Contains Another String?

A string is a collection of Characters and in python creating and manipulating a string is very easy as compared to the other programming languages. Python also provides us with many string methods that can be used to perform various operations on a string. While learning python string topic, you will defiantly come across a… Read More »

Python Program to Check if a Number is Positive, Negative or 0

In this article we have provided a Python program which is capable of telling that entered number is positive, negative or Zero. Prerequisite topics to create this program. Python Input, Output Python if…else statement Python Data types Python Operators Steps First, we ask the user to enter a number. Using the int() function we will… Read More »