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 »

Python Program to Swap Two Variables

In this article, we have provided a python source code which is capable of swapping the value of two variables. Swapping the value of two variables is a very common and easy coding problem and in every programming language, you can easily make this program. Prerequisite Topics to create this Program Python Input, Output Python… Read More »

Python Program to Find the Square Root

In this article, you will learn how can you write a program in Python programming language to calculate the square root of a number. Square Root program in Python for Real Numbers: num = float(input(“Enter the First Number: “)) res = num**0.5 print(“The Square root of {0} and is:”.format(num),round(res,2)) Output Enter the First Number: 10… Read More »