Answer to Question #221163 in Python for Hari nadh babu

Question #221163

Perfect Squares in a Range


This Program name is Perfect Squares in a Range. Write a Python program to Perfect Squares in a Range, it has two test cases


The below link contains Perfect Squares in a Range question, explanation and test cases


https://drive.google.com/file/d/1Eop1B9ddIWooAOyPsKrtt-1noUCRCSa4/view?usp=sharing


We need exact output when the code was run

1
Expert's answer
2021-07-31T07:24:07-0400
import math
A=int(input())
B=int(input())


numberPerfectSquares=0
for number in range(A,B+1):
    root = math.sqrt(number)
    if int(root + 0.5) ** 2 == number:
        numberPerfectSquares+=1
print(numberPerfectSquares)
        
    

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS