Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. x = 999
  2. y = 999
  3. n = 999 * 999
  4.  
  5. def checkPalindrome():
  6.     global n,x,y
  7.     if str(n) == str(n)[::-1]:
  8.         print (str(n)[::-1] + ' is the highest palindrome with ' + str(x) + ' * ' + str(y))
  9.     x -= 1
  10.  
  11. def getNumber():
  12.     global x,y,n
  13.     if x >= 101:
  14.         n = x * y
  15.     else:
  16.         n = x * y
  17.     return n
  18.  
  19. while x > 100 and y > 100:
  20.     n = getNumber()
  21.     checkPalindrome()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement