Advertisement
aneliabogeva

Square Numbers

Jun 17th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. # 02_lists
  2. # 10_square_numbers
  3. import math
  4.  
  5. nums_list = [int(item) for item in input().split(" ")]
  6.  
  7. res_list = []
  8.  
  9. for num in nums_list:
  10. if num > 0 and math.sqrt(num) % 1 == 0:
  11. res_list.append(num)
  12.  
  13. res_list.sort(reverse=True)
  14. print(" ".join(map(str, res_list)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement