diff --git a/problem_4.py b/problem_4.py new file mode 100644 index 0000000..c0fc66f --- /dev/null +++ b/problem_4.py @@ -0,0 +1,24 @@ +import math + + +def isPalindrome(number): + num_str = str(number) + + if len(num_str) % 2 != 0: + return False + + for i in range(0, int(len(num_str) / 2)): + if num_str[i] != num_str[len(num_str) - (i + 1)]: + return False + + return True + + +largest_number = 0 + +for x in range(0, 999): + for y in range(0, 999): + if isPalindrome(x * y) and largest_number < x * y: + largest_number = x * y + +print(largest_number) \ No newline at end of file