Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python perfect square

import math

def is_square(n):
    return n > -1 and math.sqrt(n) % 1 == 0


# Taking the input from user
number = int(input("Enter the Number: "))
if is_square(number):
    print(f'Your number: {number} is perfect square.')
else:
    print(f'Your number: {number} is not perfect square.')
Comment

PREVIOUS NEXT
Code Example
Python :: display Surface quit 
Python :: how to open excel with more than one sheetpython 
Python :: breaking big csv into chunks pandas 
Python :: how to run for loop in python 
Python :: python code formatter vs code 
Python :: pyAudioAnalysis 
Python :: flask db migrate 
Python :: python add 0 before number 
Python :: python selenium implicit wait 
Python :: send email with flask 
Python :: create 2d list dictionary 
Python :: append element to an array python 
Python :: Python - Count the Number of Keys in a Python Dictionary 
Python :: Python __gt__ magic method 
Python :: python3 hello world 
Python :: accessing data on django sessionstore 
Python :: remove alphabetic characters python 
Python :: pandas to_csv no index 
Python :: where to import kivy builder 
Python :: change tensor type pytorch 
Python :: python new line command 
Python :: Learn python 3 the hard way by by Zed Shaw 
Python :: localhost server in Python 
Python :: python bash command 
Python :: python read line into list 
Python :: django connection cursor 
Python :: pandas change multiple column types 
Python :: plot histogram in seaborn 
Python :: How to find xpath by contained text 
Python :: lecture de fichier python 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =