aboutsummaryrefslogtreecommitdiffstats
path: root/palindrome.py
diff options
context:
space:
mode:
authormjf <mjf@localhost.localdomain>2020-02-04 14:52:21 -0500
committermjf <mjf@localhost.localdomain>2020-02-04 14:52:21 -0500
commit20bc571dc655d0774529dd1f5517342e934809d5 (patch)
tree9dd629f319ed8694acbbe399e6b30195bbff4efa /palindrome.py
parent6aa02212cd6dfbb492fa1f70b60a4fe3d48892e5 (diff)
downloadProject_Euler_Solutions-20bc571dc655d0774529dd1f5517342e934809d5.tar.gz
cleanup more mistakes, add more c code
Diffstat (limited to 'palindrome.py')
-rw-r--r--palindrome.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/palindrome.py b/palindrome.py
index be3fe79..ed2a779 100644
--- a/palindrome.py
+++ b/palindrome.py
@@ -1,12 +1,9 @@
-import PIL
-import math
-
# Problem 4 - Palindrome Products
def isPalindrome(number):
numchar = str(number)
- middle = len(numchar)/2
+ middle = int(len(numchar)/2)
face = numchar[:middle]
ref = numchar[len(numchar):middle-1:-1]
if(face == ref):
@@ -37,7 +34,3 @@ print(answer)
print("The factors are: " + str(findProduct(answer)))
#x = input("Type a palindromic number: ")
-# if(isPalindrome(x)):
-# print "The factors are: " + str(findProduct(x))
-# else:
-# print "not a palindrome"