Program to find square of a number in Python
In this python program guide, we will learn to write:
program to find square of a number in python
Program to find sqaure in Python
Given below we write a python program to find the square of a number:
# Owner : TutorialsInhand Author : Devjeet Roy
number = int(input("Enter the number: "))
sq = number ** 2
print("The squared value is:",sq)
The output of the python code to find square of a number is as follows:
PS C:\Users\DEVJEET\Desktop\tutorialsInHand> python code.py
Enter the number: 4
The squared value is: 16
Few important points about this program:
1. In Python, we use the "**" operator to do calculations using exponent.
2. The number before "**" is the base, and the number after the operator is the exponent.
Would you like to see your article here on tutorialsinhand.
program by tutorialsinhand.com
About the Author
Full Stack Web Developer & Data Science Enthusiast
Page Views :
Published Date :