Python program to print all the perfect square number in the given range
In this python program guide, we will learn:
perfect squares in the given range in python
🤷♀️🤷♀️What do you mean by perfect square number ?
A number is said to be a perfect square number if it can be obtained by the multiplication of two equal integer numbers.
16 is a perfect square number because it can be obtained by the multiplication of two equal integers (4*4=16).
our task is to find all the perfect squares number in the given range by the user.
So let’s start to find the solution to this tricky problem.
📙📙 Print perfect square numbers in python in range
Code to print perfect square numbers in python is given below:
# perfect square number in the given range
t=int(input("please enter the range till program runs "))
for j in range(1,t+1): # range from 1 to t
👉👉the program will print the perfect square number in the given range as inputted by the user.
🤷♀️🤷♀️🤷♀️Output to the above program in python is given below:
please enter the range till program runs 133
Our program prints the perfect square number from 1 to the given range.
📖🎯Screenshot of running program in jupyter notebook:
As we can see our program prints the perfect square numbers in the given range. So,our program has been run successfully.
Similarly, we can print all the perfect square number between 1 and 500 in python or any range.
Thank you for reading this article. Please share, if you find this article helpful to you.👍👍👍👍
Would you like to see your article here on tutorialsinhand.
program by tutorialsinhand.com
About the Author
I am a data science enthusiast. I love to learn new technology 🛠🛠.you can reach me at this url www.linkedin.com/in/ayushbajpai47
Page Views :
Published Date :