There was an error while loading. Please reload this page.
1 parent ff0f443 commit d91f1fcCopy full SHA for d91f1fc
Problem4.py
@@ -1,4 +1,14 @@
1
-a = 10
2
-b = 10.0
+#A palindromic number reads the same both ways. The largest palindrome made from the product
+# of two 2-digit numbers is 9009 = 91 × 99.
3
+#Find the largest palindrome made from the product of two 3-digit numbers.
4
-print("%.2f" % (a + b), type(a + b))
5
+
6
+num = 0
7
+for a in range(999, 100, -1):
8
+ for b in range(a, 100, -1):
9
+ x = a * b
10
+ if x > num:
11
+ s = str(a * b)
12
+ if s == s[::-1]:
13
+ num = a * b
14
+print(num)
0 commit comments