Answer to Question #264614 in Python for swsq

Question #264614
  1. Check how many perfect squares are in a given list

Input:

[22,9, 45, 82, 81, 21]

Output:2




1
Expert's answer
2021-11-19T00:01:53-0500
t = map(int, input('Enter list of numbers: ').split())
count = 0
for n in t:
   if round(n ** .5) ** 2 == n:
      count += 1
print(count)

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