You are viewing a single comment's thread. Return to all comments →
This is the finished Python code. You should change "if num / val == 1:" to "if num / val == val".
import math def is_smart_number(num): val = int(math.sqrt(num)) if num / val == val: return True return False for _ in range(int(input())): num = int(input()) ans = is_smart_number(num) if ans: print("YES") else: print("NO")
Seems like cookies are disabled on this browser, please enable them to open this website
Smart Number
You are viewing a single comment's thread. Return to all comments →
This is the finished Python code. You should change "if num / val == 1:" to "if num / val == val".