from math import sqrt for n in range(99, 82, -1): root = sqrt(n) if root == int(root): print(n) break else: #发现这个else只有在break不执行的时候执行。这个是循环的else子句 print("Didn't find the number!")
from math import sqrt for n in range(99, 82, -1): root = sqrt(n) if root == int(root): print(n) break else: #发现这个else只有在break不执行的时候执行。这个是循环的else子句 print("Didn't find the number!")