Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created python program for perfect-square-finder #23

Merged
merged 3 commits into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions hello-world/hw.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html>
<title>Hello World</title>
<style type="text/css">
body{
background-color: grey;
text-align: center;
}
</style>
<body>
<h1>Hello World</h1>
<hr>
</body>
</html>
23 changes: 23 additions & 0 deletions perfect-square/program.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#perfect square finder
from math import sqrt
from time import sleep
def square():
num = int(input("\nEnter a Square number: "))
a = sqrt(num)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if num>1000:
print('\nProcessing...')
sleep(2)
else:
sleep(1)
if (a-int(a))==0: #checking for decimal point value
print("\nYour number is a Perfect Square !")
else:
print("\nYour number isn't a Perfect Square !")
ch = input("\nDo you want to check another number [y/n] ? ")
if ch.lower()=='y':
square()
else:
print("\n\n\t\t\t See you Soon ! ")

print("\t\t----------- Perfect Square Finder ----------- ")
square()