This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import ImageTk, Image, ImageDraw | |
import PIL | |
from tkinter import * | |
width = 200 | |
height = 200 | |
center = height // 2 | |
white = (255, 255, 255) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_palindrome(n): | |
return str(n) == str(n)[::-1] | |
def is_lychrel(n, iterations=200): | |
for _ in range(iterations): | |
n += int(str(n)[::-1]) | |
if is_palindrome(n): | |
return False | |
return True |