You are viewing a single comment's thread. Return to all comments →
def kaprekarNumbers(p, q): flag = 0 for i in range(p, q+1): d = 0 temp = i while (temp > 0): d += 1 temp = temp//10 square = i*i if (square//pow(10, d) + square % pow(10, d) == i): flag = 1 print(i, end=" ") if (flag == 0): print("INVALID RANGE") p = int(input()) q = int(input()) kaprekarNumbers(p, q)
Seems like cookies are disabled on this browser, please enable them to open this website
Modified Kaprekar Numbers
You are viewing a single comment's thread. Return to all comments →
for Python3 Platform