Skip to content

Commit d91f1fc

Browse files
authored
Update Problem4.py
1 parent ff0f443 commit d91f1fc

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

‎Problem4.py‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
a = 10
2-
b = 10.0
1+
#A palindromic number reads the same both ways. The largest palindrome made from the product
2+
# of two 2-digit numbers is 9009 = 91 × 99.
3+
#Find the largest palindrome made from the product of two 3-digit numbers.
34

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

Comments
 (0)